René's URL Explorer Experiment


Title: High cpu when using Gunicorn with multiprocess · Issue #568 · prometheus/client_python · GitHub

Open Graph Title: High cpu when using Gunicorn with multiprocess · Issue #568 · prometheus/client_python

X Title: High cpu when using Gunicorn with multiprocess · Issue #568 · prometheus/client_python

Description: I run flask app on Gunicorn 20.0.4 and Kubernetes. My python is v3.7.5. I have a problem with increasing CPU over a time. After investigating stack traces using py-spy I noticed that the issue is caused by prometheus metrics lib. It does...

Open Graph Description: I run flask app on Gunicorn 20.0.4 and Kubernetes. My python is v3.7.5. I have a problem with increasing CPU over a time. After investigating stack traces using py-spy I noticed that the issue is c...

X Description: I run flask app on Gunicorn 20.0.4 and Kubernetes. My python is v3.7.5. I have a problem with increasing CPU over a time. After investigating stack traces using py-spy I noticed that the issue is c...

Opengraph URL: https://github.com/prometheus/client_python/issues/568

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"High cpu when using Gunicorn with multiprocess","articleBody":"I run flask app on Gunicorn 20.0.4 and Kubernetes. My python is v3.7.5. I have a problem with increasing CPU over a time.\r\n![image](https://user-images.githubusercontent.com/29543308/88379047-7e903f00-cda2-11ea-8fbf-0e5b22b082a8.png)\r\nAfter investigating stack traces using py-spy I noticed that the issue is caused by prometheus metrics lib.\r\nIt doesn't clean up metric files from old workers. Therefore over a time merge process take more and more CPU. \r\n\r\nAfter deleting following files the CPU usages dropped significantly:\r\n```\r\nll -lh\r\ntotal 7.0M\r\ndrwxr-xr-x 2 root root 4.0K Jul 24 06:13 ./\r\ndrwxrwxrwt 1 root root 4.0K Jul 19 14:14 ../\r\n-rw-r--r-- 1 root root 1.0M Jul 24 08:14 counter_106.db\r\n-rw-r--r-- 1 root root 1.0M Jul 23 18:41 counter_112.db\r\n-rw-r--r-- 1 root root 1.0M Jul 24 04:07 counter_118.db\r\n-rw-r--r-- 1 root root 1.0M Jul 24 04:54 counter_136.db\r\n-rw-r--r-- 1 root root 1.0M Jul 24 08:40 counter_142.db\r\n-rw-r--r-- 1 root root 1.0M Jul 20 16:44 counter_16.db\r\n-rw-r--r-- 1 root root 1.0M Jul 20 11:24 counter_17.db\r\n-rw-r--r-- 1 root root 1.0M Jul 21 01:40 counter_18.db\r\n-rw-r--r-- 1 root root 1.0M Jul 21 20:14 counter_40.db\r\n-rw-r--r-- 1 root root 1.0M Jul 21 17:17 counter_52.db\r\n-rw-r--r-- 1 root root 1.0M Jul 21 21:29 counter_58.db\r\n-rw-r--r-- 1 root root 1.0M Jul 23 07:19 counter_70.db\r\n-rw-r--r-- 1 root root 1.0M Jul 22 19:49 counter_82.db\r\n-rw-r--r-- 1 root root 1.0M Jul 22 18:59 counter_88.db\r\n-rw-r--r-- 1 root root 1.0M Jul 24 08:43 histogram_106.db\r\n-rw-r--r-- 1 root root 1.0M Jul 24 04:15 histogram_112.db\r\n-rw-r--r-- 1 root root 1.0M Jul 24 05:02 histogram_118.db\r\n-rw-r--r-- 1 root root 1.0M Jul 24 08:43 histogram_136.db\r\n-rw-r--r-- 1 root root 1.0M Jul 24 08:43 histogram_142.db\r\n-rw-r--r-- 1 root root 1.0M Jul 20 16:46 histogram_16.db\r\n-rw-r--r-- 1 root root 1.0M Jul 20 11:45 histogram_17.db\r\n-rw-r--r-- 1 root root 1.0M Jul 21 01:51 histogram_18.db\r\n-rw-r--r-- 1 root root 1.0M Jul 21 22:41 histogram_40.db\r\n-rw-r--r-- 1 root root 1.0M Jul 21 17:45 histogram_52.db\r\n-rw-r--r-- 1 root root 1.0M Jul 22 01:44 histogram_58.db\r\n-rw-r--r-- 1 root root 1.0M Jul 23 07:37 histogram_70.db\r\n-rw-r--r-- 1 root root 1.0M Jul 23 01:01 histogram_82.db\r\n-rw-r--r-- 1 root root 1.0M Jul 22 23:40 histogram_88.db\r\n```\r\n![image](https://user-images.githubusercontent.com/29543308/88379256-e21a6c80-cda2-11ea-8836-b27f3281c5de.png)\r\n\r\nThe issue is related to https://github.com/prometheus/client_python/issues/275\r\n\r\nCan we avoid that somehow without periodically restating the k8s pod? Maybe multiprocess should use PID + UUID generated on worker rather than just PID for file names? So master could remove/merge files from dead workes?\r\n\r\n","author":{"url":"https://github.com/onzo-mateuszzakarczemny","@type":"Person","name":"onzo-mateuszzakarczemny"},"datePublished":"2020-07-24T09:46:21.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":14},"url":"https://github.com/568/client_python/issues/568"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:1f099e69-025d-ea92-b3d6-c830a4a810a9
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA55A:96DD6:3637BC:46660B:6990699C
html-safe-noncebbd1d9b9b33960b6c56414a71d5d8f4174e62c4fc1f0ada3ecb4206686f67131
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNTVBOjk2REQ2OjM2MzdCQzo0NjY2MEI6Njk5MDY5OUMiLCJ2aXNpdG9yX2lkIjoiNTI3NDY1NDE4NzAwNjc0OTA4NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacde123827a827aeb3ab1b1afdd81a1bd18f9af883309550c1ec8baf650daecdf5
hovercard-subject-tagissue:665053164
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/prometheus/client_python/568/issue_layout
twitter:imagehttps://opengraph.githubassets.com/46de37cdb379ac261d70a0425f32982036d04f0a47bffef4aebd5cfd9a98bf0b/prometheus/client_python/issues/568
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/46de37cdb379ac261d70a0425f32982036d04f0a47bffef4aebd5cfd9a98bf0b/prometheus/client_python/issues/568
og:image:altI run flask app on Gunicorn 20.0.4 and Kubernetes. My python is v3.7.5. I have a problem with increasing CPU over a time. After investigating stack traces using py-spy I noticed that the issue is c...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameonzo-mateuszzakarczemny
hostnamegithub.com
expected-hostnamegithub.com
None42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b
turbo-cache-controlno-preview
go-importgithub.com/prometheus/client_python git https://github.com/prometheus/client_python.git
octolytics-dimension-user_id3380462
octolytics-dimension-user_loginprometheus
octolytics-dimension-repository_id30618733
octolytics-dimension-repository_nwoprometheus/client_python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id30618733
octolytics-dimension-repository_network_root_nwoprometheus/client_python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release3b33c5aedc9808f45bc5fcf0b1e4404cf749dac7
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/prometheus/client_python/issues/568#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fprometheus%2Fclient_python%2Fissues%2F568
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fprometheus%2Fclient_python%2Fissues%2F568
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=prometheus%2Fclient_python
Reloadhttps://patch-diff.githubusercontent.com/prometheus/client_python/issues/568
Reloadhttps://patch-diff.githubusercontent.com/prometheus/client_python/issues/568
Reloadhttps://patch-diff.githubusercontent.com/prometheus/client_python/issues/568
prometheus https://patch-diff.githubusercontent.com/prometheus
client_pythonhttps://patch-diff.githubusercontent.com/prometheus/client_python
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fprometheus%2Fclient_python
Fork 842 https://patch-diff.githubusercontent.com/login?return_to=%2Fprometheus%2Fclient_python
Star 4.3k https://patch-diff.githubusercontent.com/login?return_to=%2Fprometheus%2Fclient_python
Code https://patch-diff.githubusercontent.com/prometheus/client_python
Issues 105 https://patch-diff.githubusercontent.com/prometheus/client_python/issues
Pull requests 28 https://patch-diff.githubusercontent.com/prometheus/client_python/pulls
Discussions https://patch-diff.githubusercontent.com/prometheus/client_python/discussions
Actions https://patch-diff.githubusercontent.com/prometheus/client_python/actions
Projects 0 https://patch-diff.githubusercontent.com/prometheus/client_python/projects
Wiki https://patch-diff.githubusercontent.com/prometheus/client_python/wiki
Security 0 https://patch-diff.githubusercontent.com/prometheus/client_python/security
Insights https://patch-diff.githubusercontent.com/prometheus/client_python/pulse
Code https://patch-diff.githubusercontent.com/prometheus/client_python
Issues https://patch-diff.githubusercontent.com/prometheus/client_python/issues
Pull requests https://patch-diff.githubusercontent.com/prometheus/client_python/pulls
Discussions https://patch-diff.githubusercontent.com/prometheus/client_python/discussions
Actions https://patch-diff.githubusercontent.com/prometheus/client_python/actions
Projects https://patch-diff.githubusercontent.com/prometheus/client_python/projects
Wiki https://patch-diff.githubusercontent.com/prometheus/client_python/wiki
Security https://patch-diff.githubusercontent.com/prometheus/client_python/security
Insights https://patch-diff.githubusercontent.com/prometheus/client_python/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/prometheus/client_python/issues/568
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/prometheus/client_python/issues/568
High cpu when using Gunicorn with multiprocesshttps://patch-diff.githubusercontent.com/prometheus/client_python/issues/568#top
https://github.com/onzo-mateuszzakarczemny
https://github.com/onzo-mateuszzakarczemny
onzo-mateuszzakarczemnyhttps://github.com/onzo-mateuszzakarczemny
on Jul 24, 2020https://github.com/prometheus/client_python/issues/568#issue-665053164
https://user-images.githubusercontent.com/29543308/88379047-7e903f00-cda2-11ea-8fbf-0e5b22b082a8.png
https://user-images.githubusercontent.com/29543308/88379256-e21a6c80-cda2-11ea-8836-b27f3281c5de.png
#275https://github.com/prometheus/client_python/issues/275
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.