Re: Recommended swap partition size
Google oom_adj and oom_score. You can control which process is most likely to be killed. On Mon, Apr 19, 2010 at 12:53 AM, Johan De Meersman wrote: > > > On Sun, Apr 18, 2010 at 9:04 PM, Eric Bergen wrote: >> >> Usually I prefer to have linux kill processes rather than excessively >> swapping. I've worked on machines before that have swapped so badly > > I guess you never had the OOM killer randomly shooting down your SSH daemon > on a machine hundred of miles away, then :-) > > > -- > Bier met grenadyn > Is als mosterd by den wyn > Sy die't drinkt, is eene kwezel > Hy die't drinkt, is ras een ezel > -- Eric Bergen eric.ber...@gmail.com http://www.ebergen.net -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: Recommended swap partition size
On Sun, Apr 18, 2010 at 9:04 PM, Eric Bergen wrote: > Usually I prefer to have linux kill processes rather than excessively > swapping. I've worked on machines before that have swapped so badly > I guess you never had the OOM killer randomly shooting down your SSH daemon on a machine hundred of miles away, then :-) -- Bier met grenadyn Is als mosterd by den wyn Sy die't drinkt, is eene kwezel Hy die't drinkt, is ras een ezel
Re: Recommended swap partition size
The impact of swap activity on performance is dependent on the rate at which things are being swapped and the speed of swapping. A few pages per second probably won't kill things but in this case it was swapping hundreds of pages per second which killed performance. Disks are much slower than ram. In my environment mysqld_safe will failover the cluster if it detects mysqld has crashed so I prefer the quick crash and failover to the long period of slow response time. Many operators prefer the long slow response time, I don't but it's a religious debate. On Sun, Apr 18, 2010 at 12:13 PM, Rob Wultsch wrote: > On Sun, Apr 18, 2010 at 12:04 PM, Eric Bergen wrote: >> Linux will normally swap out a few pages of rarely used memory so it's >> a good idea to have some swap around. 2G seems excessive though. >> Usually I prefer to have linux kill processes rather than excessively >> swapping. I've worked on machines before that have swapped so badly >> that it took minutes just to ssh to them. This is effectively a >> failure scenario that can last for a lot longer than it takes to >> restart/failover mysqld. For apache it means the clients will see >> errors until the load balancer health check drops the server out of >> rotation. The best solution in all cases is to keep an eye on swap >> in/out and memory usage so neither the crash nor the excessive >> swapping becomes a problem. >> > > > Umm, you were probably horribly over io utilized. Swapping by itself > will not kill perforance I have some boxes where mysql has leaked a > metric crap ton of memory and swapping is ok. The leaked memory is > swapped out and sits out in swap. Every now and a again I create more > swap to keep the server happy. > > Swapping is often preferable to crash with unplanned downtime. > > Note that innodb_flush_method can implact this... > > > -- > Rob Wultsch > wult...@gmail.com > -- Eric Bergen eric.ber...@gmail.com http://www.ebergen.net -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: Recommended swap partition size
On Sun, Apr 18, 2010 at 12:04 PM, Eric Bergen wrote: > Linux will normally swap out a few pages of rarely used memory so it's > a good idea to have some swap around. 2G seems excessive though. > Usually I prefer to have linux kill processes rather than excessively > swapping. I've worked on machines before that have swapped so badly > that it took minutes just to ssh to them. This is effectively a > failure scenario that can last for a lot longer than it takes to > restart/failover mysqld. For apache it means the clients will see > errors until the load balancer health check drops the server out of > rotation. The best solution in all cases is to keep an eye on swap > in/out and memory usage so neither the crash nor the excessive > swapping becomes a problem. > Umm, you were probably horribly over io utilized. Swapping by itself will not kill perforance I have some boxes where mysql has leaked a metric crap ton of memory and swapping is ok. The leaked memory is swapped out and sits out in swap. Every now and a again I create more swap to keep the server happy. Swapping is often preferable to crash with unplanned downtime. Note that innodb_flush_method can implact this... -- Rob Wultsch wult...@gmail.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: Recommended swap partition size
Linux will normally swap out a few pages of rarely used memory so it's a good idea to have some swap around. 2G seems excessive though. Usually I prefer to have linux kill processes rather than excessively swapping. I've worked on machines before that have swapped so badly that it took minutes just to ssh to them. This is effectively a failure scenario that can last for a lot longer than it takes to restart/failover mysqld. For apache it means the clients will see errors until the load balancer health check drops the server out of rotation. The best solution in all cases is to keep an eye on swap in/out and memory usage so neither the crash nor the excessive swapping becomes a problem. On Wed, Apr 14, 2010 at 3:06 AM, Glyn Astill wrote: > --- On Wed, 14/4/10, Dan Nelson wrote: > >> Hammerman said: >> > My organization has a dedicated MySQL server. The >> system has 32Gb of >> > memory, and is running CentOS 5.3. The default >> engine will be InnoDB. >> > Does anyone know how much space should be dedicated to >> swap? >> >> I say zero swap, or if for some reason you NEED swap (for >> crashdumps maybe, >> but I didn't think Linux supported that), no more than >> 2GB. With that much >> RAM, you don't ever want to be in the state where the OS >> decides to page out >> 8GB of memory (for example) to swap. We have a few >> Oracle servers with >> between 32 and 48 GB of memory and they all live just fine >> without swap. >> > > But surely better to have a server that is paging out and has slowed to a > crawl than one where the oom killer starts killing off your processes, with > no swap I'd be turning overcommit off. > > > > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/mysql?unsub=eric.ber...@gmail.com > > -- Eric Bergen eric.ber...@gmail.com http://www.ebergen.net -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: Recommended swap partition size
--- On Wed, 14/4/10, Dan Nelson wrote: > Hammerman said: > > My organization has a dedicated MySQL server. The > system has 32Gb of > > memory, and is running CentOS 5.3. The default > engine will be InnoDB. > > Does anyone know how much space should be dedicated to > swap? > > I say zero swap, or if for some reason you NEED swap (for > crashdumps maybe, > but I didn't think Linux supported that), no more than > 2GB. With that much > RAM, you don't ever want to be in the state where the OS > decides to page out > 8GB of memory (for example) to swap. We have a few > Oracle servers with > between 32 and 48 GB of memory and they all live just fine > without swap. > But surely better to have a server that is paging out and has slowed to a crawl than one where the oom killer starts killing off your processes, with no swap I'd be turning overcommit off. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: Recommended swap partition size
Correct, but when something *does* go amiss, some swap may give you the time you need to fix things before you really go down :-) So, yeah, a gig or two should be fine. There's also no real need for an actual swap partition, these days - just use a swap file. Performance is only marginally less than a dedicated partition, and it's not like you expect to use it a lot anyway. On Wed, Apr 14, 2010 at 5:59 AM, Kyong Kim wrote: > Yeah. One of the telltale signs of something amiss is excessive swap > activity. > You're not going to be happy with the performance when the swap space > is actually in use heavily. > Kyong > > On Tue, Apr 13, 2010 at 8:15 PM, Dan Nelson > wrote: > > In the last episode (Apr 13), Joe Hammerman said: > >> My organization has a dedicated MySQL server. The system has 32Gb of > >> memory, and is running CentOS 5.3. The default engine will be InnoDB. > >> Does anyone know how much space should be dedicated to swap? > > > > I say zero swap, or if for some reason you NEED swap (for crashdumps > maybe, > > but I didn't think Linux supported that), no more than 2GB. With that > much > > RAM, you don't ever want to be in the state where the OS decides to page > out > > 8GB of memory (for example) to swap. We have a few Oracle servers with > > between 32 and 48 GB of memory and they all live just fine without swap. > > > > -- > >Dan Nelson > >dnel...@allantgroup.com > > > > -- > > MySQL General Mailing List > > For list archives: http://lists.mysql.com/mysql > > To unsubscribe:http://lists.mysql.com/mysql?unsub=kykim...@gmail.com > > > > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe:http://lists.mysql.com/mysql?unsub=vegiv...@tuxera.be > > -- Bier met grenadyn Is als mosterd by den wyn Sy die't drinkt, is eene kwezel Hy die't drinkt, is ras een ezel
Re: Recommended swap partition size
Yeah. One of the telltale signs of something amiss is excessive swap activity. You're not going to be happy with the performance when the swap space is actually in use heavily. Kyong On Tue, Apr 13, 2010 at 8:15 PM, Dan Nelson wrote: > In the last episode (Apr 13), Joe Hammerman said: >> My organization has a dedicated MySQL server. The system has 32Gb of >> memory, and is running CentOS 5.3. The default engine will be InnoDB. >> Does anyone know how much space should be dedicated to swap? > > I say zero swap, or if for some reason you NEED swap (for crashdumps maybe, > but I didn't think Linux supported that), no more than 2GB. With that much > RAM, you don't ever want to be in the state where the OS decides to page out > 8GB of memory (for example) to swap. We have a few Oracle servers with > between 32 and 48 GB of memory and they all live just fine without swap. > > -- > Dan Nelson > dnel...@allantgroup.com > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/mysql?unsub=kykim...@gmail.com > > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: Recommended swap partition size
In the last episode (Apr 13), Joe Hammerman said: > My organization has a dedicated MySQL server. The system has 32Gb of > memory, and is running CentOS 5.3. The default engine will be InnoDB. > Does anyone know how much space should be dedicated to swap? I say zero swap, or if for some reason you NEED swap (for crashdumps maybe, but I didn't think Linux supported that), no more than 2GB. With that much RAM, you don't ever want to be in the state where the OS decides to page out 8GB of memory (for example) to swap. We have a few Oracle servers with between 32 and 48 GB of memory and they all live just fine without swap. -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Recommended swap partition size
Hello all, My organization has a dedicated MySQL server. The system has 32Gb of memory, and is running CentOS 5.3. The default engine will be InnoDB. Does anyone know how much space should be dedicated to swap? Thanks!