{"id":22302650,"url":"https://github.com/dataoneorg/admin_cn_profiling","last_synced_at":"2025-03-26T00:28:15.834Z","repository":{"id":71253761,"uuid":"157907353","full_name":"DataONEorg/admin_cn_profiling","owner":"DataONEorg","description":"Scripts etc for profiling CNs","archived":false,"fork":false,"pushed_at":"2018-11-20T20:33:37.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T21:17:14.818Z","etag":null,"topics":["administration","monitoring"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DataONEorg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-16T18:39:01.000Z","updated_at":"2019-09-20T15:20:38.000Z","dependencies_parsed_at":"2023-07-02T23:31:56.320Z","dependency_job_id":null,"html_url":"https://github.com/DataONEorg/admin_cn_profiling","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataONEorg%2Fadmin_cn_profiling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataONEorg%2Fadmin_cn_profiling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataONEorg%2Fadmin_cn_profiling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataONEorg%2Fadmin_cn_profiling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DataONEorg","download_url":"https://codeload.github.com/DataONEorg/admin_cn_profiling/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245565083,"owners_count":20636237,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["administration","monitoring"],"created_at":"2024-12-03T18:40:35.019Z","updated_at":"2025-03-26T00:28:15.797Z","avatar_url":"https://github.com/DataONEorg.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# admin_cn_profiling\n\nScripts etc for profiling CNs.\n\n\n## Setup\n\nThese scripts make use of Async-Profiler: https://github.com/jvm-profiling-tools/async-profiler\n\nOn the system to be profiled, follow the kernel config flag setting steps described in async-profiler. Note that this does not work on the VMs running at UCSB because of the shared kernel virtualization in use there.\n\nThen setup the profiler:\n\n```\nmkdir ~/profiling\ncd ~/profiling\ngit co https://github.com/DataONEorg/admin_cn_profiling.git\ncd admin_cn_profiling\ngit co https://github.com/jvm-profiling-tools/async-profiler.git\ncd async-profiler\nexport JAVA_HOME=\"/usr/lib/jvm/java-8-openjdk-amd64\"\nmake\n```\n\nMake a place for the resulting charts (check `/etc/group` for the sudo group on the system, here it is `admin`):\n\n```\nsudo mkdir /var/www/profiling\nchgrp -R admin /var/www/profiling\nchmod -R g+w /var/www/profiling\n```\n\n## Basic Operation\n\nThe profiler samples the call stack for the desired JVM at intervals then spits out a report. The basic process for running the profiler is:\n\n1. Determine the process id and user for the application to profile, e.g.:\n\n```\n$ sudo -u tomcat7 jps\n11218 Bootstrap\n16556 Jps\n```\n\n2. Run the profiler, e.g. for a specific time of 30 seconds against the JVM process id of `11218` and output results to a flamegraph:\n\n```\ncd ~/profiling/admin_cn_profiling/async-profiler\nGRAPH_TITLE=\"Profile at $(date +%Y-%m-%dT%H:%M:%S%z)\"\n./profile.sh -d 30 -f /tmp/profile.svg \\\n  --width 2000 \\\n  --title \"${GRAPH_TITLE}\" \\\n  11218\n```\n\n3. Copy the results to the web accessible folder and take a look in a browser:\n\n```\ncp /tmp/profile.svg /var/www/profiling\n```\n\n## Miscellanea\n\nPIDS:\n\n```\nd1listobjects -C 100 -I -F \"http://www.isotc211.org/2005/gmd-pangaea\" \u003e iso_pangaea_pids.txt\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdataoneorg%2Fadmin_cn_profiling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdataoneorg%2Fadmin_cn_profiling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdataoneorg%2Fadmin_cn_profiling/lists"}