Skip to content

Commit

Permalink
Start and stop pprof on sig
Browse files Browse the repository at this point in the history
Signed-off-by: Florent Poinsard <[email protected]>
  • Loading branch information
frouioui committed Oct 29, 2024
1 parent fe59668 commit 4586f67
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 2 deletions.
10 changes: 10 additions & 0 deletions ansible/macrobench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,20 @@
name: sysbench
tasks_from: install

- hosts: macrobench

Check failure on line 42 in ansible/macrobench.yml

View workflow job for this annotation

GitHub Actions / build

syntax-check[specific]

'include_role' is not a valid attribute for a Play

Check failure on line 42 in ansible/macrobench.yml

View workflow job for this annotation

GitHub Actions / build

syntax-check[specific]

'include_role' is not a valid attribute for a Play
include_role:
name: profile
tasks_from: start

- hosts: macrobench
roles:
- macrobench

- hosts: macrobench
include_role:
name: profile
tasks_from: stop

- name: Clean Post Macrobench
when: arewefastyet_next_exec_is_same is undefined
import_playbook: clean_macrobench.yml
16 changes: 16 additions & 0 deletions ansible/roles/profile/tasks/start.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2024 The Vitess Authors.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

---
- name: Start profiling
shell: |
kill -s USR1 $(pgrep -d " " {{vitess_profile_binary}})
when: vitess_profile_binary is defined
16 changes: 16 additions & 0 deletions ansible/roles/profile/tasks/stop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2024 The Vitess Authors.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

---
- name: Stop profiling
shell: |
kill -s USR1 $(pgrep -d " " {{vitess_profile_binary}})
when: vitess_profile_binary is defined
2 changes: 1 addition & 1 deletion ansible/roles/vtgate/templates/vtgate.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ EXTRA_VTGATE_FLAGS="\
--vtgate-config-terse-errors \
--tablet_types_to_wait REPLICA \
{% if vitess_profile_binary == 'vtgate' %}\
--pprof=\"{{vitess_profile_mode}},path=/pprof/{{arewefastyet_exec_uuid}}/vtgate-{{ gateway.id }}\" \
--pprof=\"{{vitess_profile_mode}},waitSig,path=/pprof/{{arewefastyet_exec_uuid}}/vtgate-{{ gateway.id }}\" \
{% endif %}\
{{gateway.extra_flags|default("")}} \
{{extra_vtgate_flags|default("")}} \
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/vttablet/templates/vttablet.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ EXTRA_VTTABLET_FLAGS="--alsologtostderr \
--grpc_max_message_size=67108864 \
--db_charset=utf8 \
{% if vitess_profile_binary == 'vttablet' %}\
--pprof=\"{{vitess_profile_mode}},path=/pprof/{{arewefastyet_exec_uuid}}/vttablet-{{ tablet.id }}\" \
--pprof=\"{{vitess_profile_mode}},waitSig,path=/pprof/{{arewefastyet_exec_uuid}}/vttablet-{{ tablet.id }}\" \
{% endif %}\
{{ tablet.extra_flags | default("") }} \
{{ extra_vttablet_flags | default("") }} \
Expand Down

0 comments on commit 4586f67

Please sign in to comment.