Learn about Centmin Mod LEMP Stack today
Become a Member

Is there a way to know which vhost is consuming resources?

Discussion in 'Centmin Mod Insights' started by dorobo, Jul 5, 2014.

  1. dorobo

    dorobo Active Member

    420
    104
    43
    Jun 6, 2014
    Ratings:
    +162
    Local Time:
    8:43 AM
    latest
    latest
    So let's say you have 10 domains (vhosts) and all of them get different traffic. Is there a way to know via Top (or other ways) who's currently using the nginx and php-fpm processes?

    Because right now, when we execute top in the command line all we see is

    nginx
    php-fpm
    php-fpm
    php-fpm
    mysql

    but it would be nice if we could see which vhosts is currently using it something like


    nginx
    php-fpm /home/nginx/domains/domain1.com/public
    php-fpm /home/nginx/domains/domain2.com/public

    so that we could for example if there's a "misbehaving" domain that consumes a lot of resources, we could narrow it down to that partciular vhost. Sometimes, my load is a little high than usual and I don't know which domain is consuming the resources.

    I think that is the default behavior of cPanel because you can see different users. I'm not sure because it's been years since I last used a control panel.
     
    Last edited: Jul 5, 2014
  2. eva2000

    eva2000 Administrator Staff Member

    53,614
    12,139
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,683
    Local Time:
    10:43 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Depends on where the high load is coming from nginx, php-fpm and/or mysql ? Could narrow it down it's coming from nginx or mysql with below methods

    I suppose for nginx you could use ngxtop on the access.log https://community.centminmod.com/threads/ngxtop-real-time-metrics-for-nginx.285/ ??

    for mysql, processlist would show the active mysql username/databases in use

    Code:
    mysqladmin -u root -p proc
    php-fpm, would need to setup multiple php-fpm pools one for each vhost would be time consuming to do manually

    Right now, Centmin Mod isn't made for shared hosting environment so wouldn't expect any such native features any time soon.