pushing apache2 past 1500 concurrent connections

I am trying to scale to 4000 concurrent connections on a ubuntu/apache box.

It is 8 core / 64gb ram, so it is not hitting memory or cpu, or any resources for that matter. The problem is with configuration. running on aws.

Serving a static file that says 'hello world';

What i have tried so far:

<IfModule prefork.c>
StartServers       500
MinSpareServers    2000
MaxSpareServers   4000
ServerLimit      5000
MaxClients       50000
MaxRequestsPerChild  10000
</IfModule>

It works perfectly until 1500 concurrent users, then every connection added after that fails or times out.

What else can i look at?


Solution 1:

Have you tried adjusting Apache's ulimit? It's set in /etc/apache2/envvars.

## If you need a higher file descriptor limit, uncomment and adjust the
## following line (default is 8192):
#APACHE_ULIMIT_MAX_FILES='ulimit -n 65536'