CPU usage creeps with latest Raven client on Tornado
See original GitHub issueAfter upgrading one of our (SeatGeek) production services to use the latest version of Raven (raven==5.24.3
at the time) we experience consistent CPU usage spike to 100% and eventually crash the API workers.
After some profiling it New Relic it appears that it’s somehow related to the new(ish) breadcrumbs feature.
Let me know if I can do anything else to help debug this.
Issue Analytics
- State:
- Created 7 years ago
- Comments:16 (4 by maintainers)
Top Results From Across the Web
Tornado Server using most of the cpu while ... - Stack Overflow
I am using Tornado Server, 4.4.2 and pypy 5.9.0 and python 2.7.13, hosted on Ubuntu 16.04.3 LTS. A new client logs in and...
Read more >Untitled
Ristorante bottega di montecitorio, New super fast cars, 4 tygodnie ciazy ... Nt kernel system high cpu usage vista, Bethuelsen blogg, Pennsville post ......
Read more >Predict_author-checkpoint - Jupyter Notebooks Gallery
A gallery of the most interesting jupyter notebooks online.
Read more >Tornado websocket throughput capacity - Google Groups
The client simulates the approximate size and timing of messages that we will ... CPU usage grows proportionately with data throughput so I...
Read more >Awesome Games Done Quick 2023 Online All Submissions
The speedrun is brand new, and requires careful routing, along with quick ... Use of special moves, such as the Tornado Spin, can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We’ve been having what seems to be this issue on our servers for the past few months causing us a lot of server instability and headaches trying figure out what was going on. For us it seems to be an issue when certain timeouts pile up, which causes raven to start consuming a lot of cpu and memory, causing more timeouts and eventually causing our server to hang. I’ve created some example code to reproduce the problem:
Run
python script.py 0
in one terminal andpython script 1
in another to reproduce the results. Whencount
reaches about 30 in the while loop, the server really starts to slow down to a crawl. This cpu usage is being seen in the Client.encode function of base.py, as the size of the json it’s trying to output reaches 100’s of megabytes. Turning off breadcrumbs seems to fix the issue.In the script I’ve modified the time.time function to simulate a long running, blocking operation. This is not entirely fair since it doesn’t give any extra time to do garbage collection, and using time.sleep(30) instead seems to cause the problem to either not happen, or at least happen very slowly. I’ve found that in this example, using a time.sleep(5) instead will reproduce the problem without having to modify time.time at all (in this case by
count = 20
the size of the json reaches 100k, and bycount = 60
it’s about 70mb, atcount = 86
it’s 1.4gb and the single tornado application is taking up 21gb of memory).Strangely enough, when the time.sleep(5) and the modified time.time are removed, there is no issue and the json size doesn’t seem to go above 35k.
The version of raven used for the above was 6.7.0, but the problem still seems to exists for older versions, even back to 5.15.0, though different versions do behave slightly differently.
I’m having exactly the same issue as @BarryJRowe, we had to stop using sentry for our services. I’ve looking into it, and
AsyncSentryClient
was trying to send multiple requests with 200Mb of data, so processes were growing to several gigabytes of memory usage just for sentry processing!