To run Apache Bench run this command from ssh:
ab -n 1000 -c 10 http://example.org/
The number after -n represents how many requests to make and the number after -c determines the concurrency level.
I usually run multiple tests and increase the concurrency level each time till I get up to 100.
This won't necessarily tell you how to adjust the shm_size but its good for testing the various caching methods like disk enhanced vs APC or APC vs Memcached for database and object caching.
The number I use to determine best performance is requests per second.
Here is a sample output from the a run with 5000 requests at a 100 concurrency level on a VPS running Apache with Nginx as a front end proxy.
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking wp-performance.com (be patient)
Completed 500 requests
Completed 1000 requests
Completed 1500 requests
Completed 2000 requests
Completed 2500 requests
Completed 3000 requests
Completed 3500 requests
Completed 4000 requests
Completed 4500 requests
Completed 5000 requests
Finished 5000 requests
Server Software: nginx/0.7.65
Server Hostname: wp-performance.com
Server Port: 80
Document Path: /
Document Length: 9348 bytes
Concurrency Level: 100
Time taken for tests: 0.607 seconds
Complete requests: 5000
Failed requests: 0
Write errors: 0
Total transferred: 49172298 bytes
HTML transferred: 46870872 bytes
Requests per second: 8242.83 [#/sec] (mean)
Time per request: 12.132 [ms] (mean)
Time per request: 0.121 [ms] (mean, across all concurrent requests)
Transfer rate: 79163.82 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 0.9 1 9
Processing: 3 11 1.8 11 61
Waiting: 1 5 2.1 5 54
Total: 5 12 1.7 12 61
Percentage of the requests served within a certain time (ms)
50% 12
66% 12
75% 13
80% 13
90% 14
95% 15
98% 15
99% 16
100% 61 (longest request