Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I want to find out the memory cost of each mysql process. Right now, I have 800+ mysql connections but I have no idea when will the system start swapping. I use FreeBSD.

share|improve this question

3 Answers 3

The amount of memory consumed by each connection is variable, depending on what queries you're running, the size of result sets, and probably the phase of the moon. You'll want to measure current memory usage, and (assuming a bunch here) extrapolate from the current average memory usage of a connection to work out how many connections you can get.

The problem with this method is that memory may not be your limiting factor -- query contention, disk IO, or whatever could kill you before you start swapping.

share|improve this answer

You can determine the maximum memory cost per-connection to the server fairly easily from your configuration variables.

Obtaining your actual memory usage per-connection is unfortunately a lot more difficult because of the way in which mysqld threads.

share|improve this answer

Another good tool that I use for understanding/configuring how mysql uses memory is mysqlreport.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.