Python app CPU usage
I've recently deployed a Python app (Flask+Marshmallow) to my web host which runs cPanel. My understanding is this runs through Passenger, however I don't have access to (as far as I know) the configuration for Passenger.
Looking at my general cPanel dashboard I now see increasing CPU usage for each new user of my Python app, and I'm slightly worried that I might hit some sort of problem very soon if this continues. It might be that I am wrong, given that I'm not very sure of how Passenger is set up and how it functions.
* Will Passenger+Python automatically "cap out" gracefully, simply limiting my apps performance, or might I get some other type of problem?
* Does Passenger+Python create a new process for each request, or does it reuse processes if they are not currently processing any request?
* Might it be that currently my CPU usage is high because it quickly got up to Passengers "max pool size" in terms of processes, and It'll flat out the increase in CPU usage, or can I expect CPU usage to keep rising for each new user (adding more requests towards my app endpoints)?
I'm kind of looking both for tips on increasing performance, as well as an explanation to why I'm seeing very high CPU usage (70%++) with not that many requests (IMO), at lets for example say 2-3 per second. Clearly I was expecting this kind of CPU usage at WAY more than a couple requests per seconds.
-
Hello @TragedyStruck, Are you using a feature called Setup Python App in cPanel? If so, this is a third-party plugin offered as part of CloudLinux: Python and Ruby Selector I recommend contacting your web hosting provider for more information about how they have configured the plugin and any of the corresponding CloudLinux usage limits. Let us know the outcome if possible. Thank you. 0 -
Better late than never. Turns out the CPU issues in this case were my fault. It was simply a part of the code that used bcrypt hashing that was called quite often and caused this very bad performance. 0
Please sign in to leave a comment.
Comments
2 comments