Question

I have a single web app running on a single server. All users use this one app and nothing else. I need to figure out how much memory each instance of httpd takes up. This way I'll know how much ram my new server will need for X users.

the ps -aux command gives me % of memory used. I read online that is % is out of "available memory". What does "available memory" mean to linux?

I found several articles that explain how not to calculate memory usage in linux but I could not find one that would teach how calculate how much memory each httpd needs. Please assist.

Was it helpful?

Solution

The %MEM field in ps is described thus in the ps man page:

%MEM ratio of the process's resident set size to the physical memory on the machine, expressed as a percentage.

Calculating the memory required by each httpd process is not straightforward - it will highly depend on your webapp itself. httpd processes will also share significant amounts of memory with each other.

The simplest way will be to test. Perform tests with different numbers of users using your webapp simultaneously (eg. 5 users, 10 users, 20 users) and sample the used memory (from the first number on the -/+ buffers/cache: line in the output of the free command). Plot the results, and you should be able to extrapolate to larger numbers of users.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top