• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Plesk & Centos 8 & 100's of websites

prjc

New Pleskian
Hello,
is there any up-to-date, summarized info how to fine-tune a Plesk server on Centos (or, any linux box), so we can easily host at least 100+ low-traffic websites on Plesk? We have pretty heavy-weight HW (256G of RAM, NVMEs etc), but I was a little surprised, that after app. 30 domains, the server started to become really slow while using WordPress admin dashboard. The reason was (of course) ulimit of 1024 files / tables (Configuring Linux for MariaDB) so the database and IO was stuck even if SSDs were sleeping. After splitting these domains across multiple Plesk installations, even with slow HDD's, the speed became 10x better. Is there any complete set of things to check, before I try to put 100 subscriptions with 10-100 unique visits/ day / domain into a single Plesk again? Thank you!
 
If your disk space and cpu power allows it, nothing speaks against 1,500+ websites on a single machine.

However, you are addressing system limits.

I'd update the "per_source" entry in /etc/xinetd.conf to allow more concurrent operations from the same source.

And also update /etc/sysctl.conf with large values for several services, for example
nginx soft nofile 500000
nginx hard nofile 500000
root soft nofile 500000
root hard nofile 500000
psaadm soft nofile 500000
psaadm hard nofile 500000
mysql soft nofile 500000
mysql hard nofile 500000
httpd soft nofile 500000
httpd hard nofile 500000

You'll also need to set /etc/sysctl.conf with
fs.file-max = 500000

And for Nginx you might consider a setting in /etc/nginx/ulimit.global_params like
worker_rlimit_nofile 500000;
and in the [Service] section of /usr/lib/systemd/system/nginx.service
LimitNOFILE=500000

This should also go into /etc/sysconfig/nginx.systemd:
LimitNOFILE=500000

I'd also consider to upgrade the MariaDB limit with an extra .conf file in /etc/systemd/system/mariadb.service.d/ like
[Service]
LimitNOFILE=500000

And for Apache you'll need to check /usr/sbin/apachectl for the ULIMIT_MAX_FILE sections and maybe adapt this, too, like with an
ulimit -n 500000
that overrides the other settings.

After all these changes, run
# systemctl --system daemon-reload
and restart all affected services.
The 50000 here is just an example. A lower number will be o.k., but you have to give the server enough headroom to never run into the limit of file handles.
 
As for the answer to your latter question:
Is there any complete set of things to check, before I try to put 100 subscriptions with 10-100 unique visits/ day / domain into a single Plesk again?
The database itself could pose a bottleneck if you have sufficiently tested it. You always want to benchmark your server an see how it performs when pushed to the limits. You could check out loader.io, k6s.io, work, h2load, ab, siege, etc

You'll also want to make sure Apache mod_event (which I assume you're using) has it's worker/thread configurations properly tuned so you don't hit a bottleneck with that.

PHP should also be tuned. I believe OpCache defaults to 128MB of memory - far from sufficient for lots of sites. I'd increase this.

Plesk can host high traffic - I know because we do it :) - there's no need to split it up onto smaller servers.
 
John, we do have PHP fine-tuned (I suppose you talk about on-demand, dynamic, etc).. as well as OpCache is set high (watching is it has free mem and interned strings), however I was really surprised that the problem may be in lower OS level. A asked because only info was on MariaDB website and seems like Plesk is OK with 30 as a maximum :) Thank you both, as Peter pretty perfectly sent, the main problem is in archaic settings of 1024 limits from single-user boxes. I think if you have 50 websites * db 60 tables, even ultra-fast NVME wont help if you need to wait for switch of file pointers
 
Back
Top