TragedyStruck

Member
Aug 11, 2017
6
1
3
Sweden
cPanel Access Level
Website Owner
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,201
363
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:

CloudLinux - Main | New template

CloudLinux documents more information about this feature on the link below:

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.
 

TragedyStruck

Member
Aug 11, 2017
6
1
3
Sweden
cPanel Access Level
Website Owner
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.