0

New sysadmin here, managing a CentOS server. This past week has been one of the most exciting weeks of my career, and full of learning all sorts of new things. Today I have another task though, and that is to make sure our server can handle more than what our old shared-hosting was capable of.

We were originally limited to 200 concurrent connections on our GoDaddy shared-hosting. Eventually we out-grew this (usually during campaigns/marketing events) and moved on to a Virtual Dedicated Server. I'm assuming the number of connections would be handled by Apache.

What configurations should I be mindful of in order to allow more traffic in?

2 Answers 2

2

Are you just talking about serving static Web pages? If you have any kind of programmatic back end, there's a host of different answers to that, but for Apache it's definitely the process model and number of processes/threads allowed. You also want to read general UNIX Apache tuning guides and make sure you have adequate processes per user and open files (ulimit -n and -u show these; set using nproc and nofile in /etc/security/limits.conf and enable that by adding "session required /lib/security/pam_limits.so" in /etc/pam.d/login).

In older Apache you always use the "prefork" model which generates a separate process per thread - that's the old MaxClients setting. If you are using a bunch of modules and whatnot, 200-250 Apache processes can easily fill up a machine that has only a modest amount of RAM. Make sure you're using newer Apache and are using the "worker" MPM which uses a different threading model, it'll get you a bit more per server (requires some more settings to tune that).

If you need extreme scalability, transition to nginx or the like off Apache. But if the scenario is just "somewhat more than 200", Apache's fine.

Make sure to set your Timeout to something reasonably low unless you're serving huge files, like 30 or so.

Use compression and caching.

2
  • Excellent information, @Ernest. The application is a mvc-database project, so there are very few static pages (if any). You had many great suggestions, but unfortunately I'm not as experienced as I'd like to be. Any links to further my reading on the various items you mentioned would be greatly appreciated.
    – Sampson
    Jun 1, 2010 at 14:46
  • Sure; not familiar with mvc-database, is that php? What technologies exactly are you using (names and versions...)? And are you running web, app, and database tier all on the same box? Performance aside, the #1 thing to do is to make sure every number of connections setting in the system matches. Usually there's the Apache number of processes, some kind of similar setting in the Apache to app server gateway, a database connection pool in the app server level, and a number of connections the database allows. The most common noob mistake is having 3 of 4 of these set high but one set low. Jun 1, 2010 at 16:27
0

Also as you will be reaching higher load you may need to adjust Linux firewall settings, especially conntack module. There are some articles available on the Internet, mine one is here: http://timanovsky.wordpress.com/2009/04/10/tuning-linux-firewall-connection-tracker-ip_conntrack/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .