Website high CPU usage - set limits

Discussion in 'Installation/Configuration' started by pecka33, Sep 23, 2023.

  1. pecka33

    pecka33 Member


    i have didicated server with a lot of customers. One of them hav a none optimize website with a lot of visitors and thats have affect to site of all customers - this specific website have a high cpu usage - 50 % and more and all websites of my customers are slowly because this one.
    Is here any way how to protect them, set limitis for this specific site for example set max. cpu usage etc.?

    I have contacted customer about it and he is working on optimize, but i am looking for other solution.
    Thank you.
  2. michelangelo

    michelangelo Active Member

    Resource limitation of the webspaces is currently not possible in ISPConfig.

    However, if you don't have it yet, I would suggest to install a monitoring stack like Prometheus/Grafana to monitor your systems with the corresponding exporters so that you can get notified if a webspace consumes more resources than necessary, so that you can take manual countermeasures.
    ahrasis likes this.
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    As far as I know, there is no easy way to limit resource usage per pool in PHP-FPM. And that's why such a setting does not exist in ISPConfig, as the underlying software does not support to limit it. You could try to write a bash script that runs in regular intervals (as process id might change on php-fpm restart) to find the php-fpm process of that website and then uses cpulimit command to restrict its CPU usage.
    ahrasis likes this.
  4. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    I'd go along with creating own script too for this case. Other than that I'd may consider to use some proxy and load balancing approach as well.

Share This Page