简体   繁体   中英

How do you simulate memory shortage with MySQL?

I want to know how my system behaves under a high load. To do so I would like to artificially reduce the amount of memory available to MySQL. How should I do this?

If you're on a linux system, you can take advantage of ulimit . Given that a shell uses very little memory, you could open a shell and run:

ulimit -m <memory size>

to limit the memory for that shell, and then start your MySQL server there.

One possible solution would be to run the app and MySQL in a virtualized environment. You can generally control the RAM and number of CPUs to see how it would perform.

Check out http://www.virtualbox.org , it's the best one I've used and it's free.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM