Re: Process Limit on Linux ?
Hi, Since shm (shared memory) in Unix/Linux is only used to share memory between independent processes and mysql server is a single process (multi-threaded), I am convinced that shmmax value has no consequence on mysql. (OTOH Oracle has a multiprocess architecture and uses shared memory). Hope this helps, Joseph Bueno Philipp wrote: Dear Walt, dear List, thank you for your reply. Finally a suggestions at all. I checked both /proc/sys/kernel/threads-max /proc/sys/kernel/shmmax I dont think threads-max will be a problem, because the value is 14336, and i dont think my system will ever have to handle this number of threads. But researching shmmax at google i got several hits. Most are dealing with postgres but perhaps its the same with mysql. shmmax ist 32 MB. on one page the author suggest to raise this value to 128 MB. What are your suggestions for the values: shmall shmmax shmmni ? Thank you very much, Yours Philipp - Original Message - From: walt [EMAIL PROTECTED] To: Philipp [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Monday, March 17, 2003 6:48 PM Subject: Re: Process Limit on Linux ? Philipp wrote: Hi there, i wrote several times to the list asking for help with a problem regarding process limits on linux, but never got an answer. today i found this story: http://www.mysql.com/press/user_stories/handy.de.html here are the relevant sentences: We had some process limit problems on our Linux Systems, but thanks to your support we where able to patch the linux boxes and move the limit to a size that meets our needs (we've got an average of about 1600 concurrent threads per server). These people use 2.2 Kernels so i dont know if the mentioned kernel and glibc patching is also relevant for me, as i am using 2.4 kernels only. Here is my problem in detail: i am using mysql-3.23.55 binary packages on linux 2.4.20 and i raised ulimit values and configuration in my.conf to allow more then 1500 threads. but when there are around 750 threads a new client connecting is told something like that (dont have the errno at the moment, i think its 11): cant create new thread, perhaps you are out of memory or there is a os-depended bug. The machine only runs apache and mysql and is a Xeon 2x2 2.4 Gz with 2 GB of RAM. cat /proc/meminfo sais that more then 1 Gig is used for caching, so memory should be no problem . Please, if you have any ideas, let me know. If it is a kernel issue, tell me to go to linux mailing lists or if its some kind of secret issue only the support will be able to answer let me know that. Thanks in advance, Philipp - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php Philipp, Did you check /proc/sys/kernel/threads-max? I know with oracle 8i, you are supposed to increase /proc/sys/kernel/shmmax as well as some other values. You might check into that and see if changing those values will help. Does your syslog say anything when these problems occur? walt walt - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Process Limit on Linux ?
Hi Joseph, thank you for your answer. While i was reading about clustering some weeks ago i read the openmosix FAQ claiming that openmosix would not work with apache, because apache was using shared memory to communicate with its threads, and i always thought mysql is designed the same way. Please someone correct me if i am wrong. Regards, Philipp On Wed, 19 Mar 2003 10:41:21 +0100 Joseph Bueno [EMAIL PROTECTED] wrote: Hi, Since shm (shared memory) in Unix/Linux is only used to share memory between independent processes and mysql server is a single process (multi-threaded), I am convinced that shmmax value has no consequence on mysql. (OTOH Oracle has a multiprocess architecture and uses shared memory). Hope this helps, Joseph Bueno Philipp wrote: Dear Walt, dear List, thank you for your reply. Finally a suggestions at all. I checked both /proc/sys/kernel/threads-max /proc/sys/kernel/shmmax I dont think threads-max will be a problem, because the value is 14336, and i dont think my system will ever have to handle this number of threads. But researching shmmax at google i got several hits. Most are dealing with postgres but perhaps its the same with mysql. shmmax ist 32 MB. on one page the author suggest to raise this value to 128 MB. What are your suggestions for the values: shmall shmmax shmmni ? Thank you very much, Yours Philipp - Original Message - From: walt [EMAIL PROTECTED] To: Philipp [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Monday, March 17, 2003 6:48 PM Subject: Re: Process Limit on Linux ? Philipp wrote: Hi there, i wrote several times to the list asking for help with a problem regarding process limits on linux, but never got an answer. today i found this story: http://www.mysql.com/press/user_stories/handy.de.html here are the relevant sentences: We had some process limit problems on our Linux Systems, but thanks to your support we where able to patch the linux boxes and move the limit to a size that meets our needs (we've got an average of about 1600 concurrent threads per server). These people use 2.2 Kernels so i dont know if the mentioned kernel and glibc patching is also relevant for me, as i am using 2.4 kernels only. Here is my problem in detail: i am using mysql-3.23.55 binary packages on linux 2.4.20 and i raised ulimit values and configuration in my.conf to allow more then 1500 threads. but when there are around 750 threads a new client connecting is told something like that (dont have the errno at the moment, i think its 11): cant create new thread, perhaps you are out of memory or there is a os-depended bug. The machine only runs apache and mysql and is a Xeon 2x2 2.4 Gz with 2 GB of RAM. cat /proc/meminfo sais that more then 1 Gig is used for caching, so memory should be no problem . Please, if you have any ideas, let me know. If it is a kernel issue, tell me to go to linux mailing lists or if its some kind of secret issue only the support will be able to answer let me know that. Thanks in advance, Philipp - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php Philipp, Did you check /proc/sys/kernel/threads-max? I know with oracle 8i, you are supposed to increase /proc/sys/kernel/shmmax as well as some other values. You might check into that and see if changing those values will help. Does your syslog say anything when these problems occur? walt walt -- - Philipp Steinkrueger Oberberg Online Informationssysteme GmbH Technik http://www.oberberg.net PGPkeyID: 690A9504 Key Fingerprint: 35CE 467E C813 06B0 B8E3 0275 2B1E E84A 690A 9504 - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Process Limit on Linux ?
In the last episode (Mar 19), Philipp said: thank you for your answer. While i was reading about clustering some weeks ago i read the openmosix FAQ claiming that openmosix would not work with apache, because apache was using shared memory to communicate with its threads, and i always thought mysql is designed the same way. Please someone correct me if i am wrong. SYSV shared memory (shm*) is a block of memory that one process creates, and depending on the access flags, multiple processes can attach to and see each other's changes. Threads use shared memory by definition, because a threaded application is still one process. No SYSV shm tricks are needed. Openmosix won't be able to balance mysql threads, because even if it were possible to synchronize shared memory between machines with Mosix, synching thread mutexes would be horrendously slow. Better to just get a multi-CPU box. -- Dan Nelson [EMAIL PROTECTED] - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Process Limit on Linux ?
Hi Dan, i just talked about openmosix because i read about shared memory segments. my only desire is to make mysql able to spawn 1000-1500 connections and *not* to tell my client cant create new thread, perhaps out of memory while 1.5 GB of RAM is only used for caching. Is that really possible that mysql is not able to handle this amount of connections ? My best Regards, Philipp On Wed, 19 Mar 2003 10:01:38 -0600 Dan Nelson [EMAIL PROTECTED] wrote: In the last episode (Mar 19), Philipp said: thank you for your answer. While i was reading about clustering some weeks ago i read the openmosix FAQ claiming that openmosix would not work with apache, because apache was using shared memory to communicate with its threads, and i always thought mysql is designed the same way. Please someone correct me if i am wrong. SYSV shared memory (shm*) is a block of memory that one process creates, and depending on the access flags, multiple processes can attach to and see each other's changes. Threads use shared memory by definition, because a threaded application is still one process. No SYSV shm tricks are needed. Openmosix won't be able to balance mysql threads, because even if it were possible to synchronize shared memory between machines with Mosix, synching thread mutexes would be horrendously slow. Better to just get a multi-CPU box. -- Dan Nelson [EMAIL PROTECTED] -- - Philipp Steinkrueger Oberberg Online Informationssysteme GmbH Technik http://www.oberberg.net PGPkeyID: 690A9504 Key Fingerprint: 35CE 467E C813 06B0 B8E3 0275 2B1E E84A 690A 9504 - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Process Limit on Linux ?
Hi, You may get a signal 11 because mysqld process is running out of virtual memory (instead of physical memory). If you want to run 1500 simultaneous connections, you have to be very careful on how mysqld allocates its memory: Since you are on a 32bits system, a process is limited to 4Gb. On Linux, these 4Gb are split in 3Gb user space/1Gb kernel space and user space is split in 1Gb code segment/2Gb data segment. So you have only 2Gb for all mysqld data. You can get more info on how mysqld allocates memory at: http://www.mysql.com/doc/en/Memory_use.html and http://www.mysql.com/doc/en/InnoDB_start.html if you have InnoDB. As a rule of thumb, execute 'show variables', evaluate: key_buffer_size + innodb_additional_mem_pool_size + innodb_buffer_pool_size + innodb_log_buffer_size = global_data_size thread_stack + 2 * net_buffer_length (1 connection buffer, 1 result buffer) + record_buffer OR record_rnd_buffer (depends on table access method) + sort_buffer_size (if resultset needs to be sorted) = per_thread_data_size and make sure that: global_data_size + per_thread_data_size * nb_of_connections 2Gb Although I have never run mysql with more than ~600 connections, I have used this formula (a simplified version since I don't use InnoDB) to allocate a key_buffer as big as possible and make sure that I won't run out of memory. Hope this helps, Joseph Bueno Philipp wrote: Hi Dan, i just talked about openmosix because i read about shared memory segments. my only desire is to make mysql able to spawn 1000-1500 connections and *not* to tell my client cant create new thread, perhaps out of memory while 1.5 GB of RAM is only used for caching. Is that really possible that mysql is not able to handle this amount of connections ? My best Regards, Philipp On Wed, 19 Mar 2003 10:01:38 -0600 Dan Nelson [EMAIL PROTECTED] wrote: In the last episode (Mar 19), Philipp said: thank you for your answer. While i was reading about clustering some weeks ago i read the openmosix FAQ claiming that openmosix would not work with apache, because apache was using shared memory to communicate with its threads, and i always thought mysql is designed the same way. Please someone correct me if i am wrong. SYSV shared memory (shm*) is a block of memory that one process creates, and depending on the access flags, multiple processes can attach to and see each other's changes. Threads use shared memory by definition, because a threaded application is still one process. No SYSV shm tricks are needed. Openmosix won't be able to balance mysql threads, because even if it were possible to synchronize shared memory between machines with Mosix, synching thread mutexes would be horrendously slow. Better to just get a multi-CPU box. -- Dan Nelson [EMAIL PROTECTED] - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Process Limit on Linux ?
In the last episode (Mar 19), Philipp said: i just talked about openmosix because i read about shared memory segments. my only desire is to make mysql able to spawn 1000-1500 connections and *not* to tell my client cant create new thread, perhaps out of memory while 1.5 GB of RAM is only used for caching. Is that really possible that mysql is not able to handle this amount of connections ? With appropriate tuning you should be able to handle that amount. Check the list archives; there have been many posts showing how to adjust Linux's limits to allow for lots of threads. -- Dan Nelson [EMAIL PROTECTED] - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Process Limit on Linux ?
On Wednesday 19 March 2003 12:38 pm, Dan Nelson wrote: In the last episode (Mar 19), Philipp said: i just talked about openmosix because i read about shared memory segments. my only desire is to make mysql able to spawn 1000-1500 connections and *not* to tell my client cant create new thread, perhaps out of memory while 1.5 GB of RAM is only used for caching. Is that really possible that mysql is not able to handle this amount of connections ? With appropriate tuning you should be able to handle that amount. Check the list archives; there have been many posts showing how to adjust Linux's limits to allow for lots of threads. I just saw in the latest mysql manual (downloaded per page html tarball) in the linux installation notes a discussion on linux threads. The html file is manual_Installing.html#Linux -- Walter Anthony System Administrator National Electronic Attachment Atlanta, Georgia 1-800-782-5150 ext. 1608 If it's not broketweak it - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Process Limit on Linux ?
Dear Walt, dear List, thank you for your reply. Finally a suggestions at all. I checked both /proc/sys/kernel/threads-max /proc/sys/kernel/shmmax I dont think threads-max will be a problem, because the value is 14336, and i dont think my system will ever have to handle this number of threads. But researching shmmax at google i got several hits. Most are dealing with postgres but perhaps its the same with mysql. shmmax ist 32 MB. on one page the author suggest to raise this value to 128 MB. What are your suggestions for the values: shmall shmmax shmmni ? Thank you very much, Yours Philipp - Original Message - From: walt [EMAIL PROTECTED] To: Philipp [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Monday, March 17, 2003 6:48 PM Subject: Re: Process Limit on Linux ? Philipp wrote: Hi there, i wrote several times to the list asking for help with a problem regarding process limits on linux, but never got an answer. today i found this story: http://www.mysql.com/press/user_stories/handy.de.html here are the relevant sentences: We had some process limit problems on our Linux Systems, but thanks to your support we where able to patch the linux boxes and move the limit to a size that meets our needs (we've got an average of about 1600 concurrent threads per server). These people use 2.2 Kernels so i dont know if the mentioned kernel and glibc patching is also relevant for me, as i am using 2.4 kernels only. Here is my problem in detail: i am using mysql-3.23.55 binary packages on linux 2.4.20 and i raised ulimit values and configuration in my.conf to allow more then 1500 threads. but when there are around 750 threads a new client connecting is told something like that (dont have the errno at the moment, i think its 11): cant create new thread, perhaps you are out of memory or there is a os-depended bug. The machine only runs apache and mysql and is a Xeon 2x2 2.4 Gz with 2 GB of RAM. cat /proc/meminfo sais that more then 1 Gig is used for caching, so memory should be no problem . Please, if you have any ideas, let me know. If it is a kernel issue, tell me to go to linux mailing lists or if its some kind of secret issue only the support will be able to answer let me know that. Thanks in advance, Philipp - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php Philipp, Did you check /proc/sys/kernel/threads-max? I know with oracle 8i, you are supposed to increase /proc/sys/kernel/shmmax as well as some other values. You might check into that and see if changing those values will help. Does your syslog say anything when these problems occur? walt walt - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Process Limit on Linux ?
Hi Walt, i am using PHP to generate the connections. The maximum was around 750 Connections. I am sure it never was more then 800. At the moment i have queries per second avg: 548.286 Regards, Philipp - Original Message - From: walt [EMAIL PROTECTED] To: Philipp [EMAIL PROTECTED] Sent: Tuesday, March 18, 2003 7:11 PM Subject: Re: Process Limit on Linux ? On Tuesday 18 March 2003 01:01 pm, you wrote: Dear Walt, dear List, thank you for your reply. Finally a suggestions at all. I checked both /proc/sys/kernel/threads-max /proc/sys/kernel/shmmax I dont think threads-max will be a problem, because the value is 14336, and i dont think my system will ever have to handle this number of threads. But researching shmmax at google i got several hits. Most are dealing with postgres but perhaps its the same with mysql. shmmax ist 32 MB. on one page the author suggest to raise this value to 128 MB. What are your suggestions for the values: shmall shmmax shmmni ? I really couldn't give you good values for these. I just remember Oracle suggested changes to them. What are you using to generate the connections (perl, c/c++, php, etc.)? -- Walter Anthony System Administrator National Electronic Attachment Atlanta, Georgia 1-800-782-5150 ext. 1608 If it's not broketweak it - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Process Limit on Linux ?
Philipp wrote: Hi there, i wrote several times to the list asking for help with a problem regarding process limits on linux, but never got an answer. today i found this story: http://www.mysql.com/press/user_stories/handy.de.html here are the relevant sentences: We had some process limit problems on our Linux Systems, but thanks to your support we where able to patch the linux boxes and move the limit to a size that meets our needs (we've got an average of about 1600 concurrent threads per server). These people use 2.2 Kernels so i dont know if the mentioned kernel and glibc patching is also relevant for me, as i am using 2.4 kernels only. Here is my problem in detail: i am using mysql-3.23.55 binary packages on linux 2.4.20 and i raised ulimit values and configuration in my.conf to allow more then 1500 threads. but when there are around 750 threads a new client connecting is told something like that (dont have the errno at the moment, i think its 11): cant create new thread, perhaps you are out of memory or there is a os-depended bug. The machine only runs apache and mysql and is a Xeon 2x2 2.4 Gz with 2 GB of RAM. cat /proc/meminfo sais that more then 1 Gig is used for caching, so memory should be no problem . Please, if you have any ideas, let me know. If it is a kernel issue, tell me to go to linux mailing lists or if its some kind of secret issue only the support will be able to answer let me know that. Thanks in advance, Philipp - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php Philipp, Did you check /proc/sys/kernel/threads-max? I know with oracle 8i, you are supposed to increase /proc/sys/kernel/shmmax as well as some other values. You might check into that and see if changing those values will help. Does your syslog say anything when these problems occur? walt walt - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Process Limit on Linux ?
Hi there, i wrote several times to the list asking for help with a problem regarding process limits on linux, but never got an answer. today i found this story: http://www.mysql.com/press/user_stories/handy.de.html here are the relevant sentences: We had some process limit problems on our Linux Systems, but thanks to your support we where able to patch the linux boxes and move the limit to a size that meets our needs (we've got an average of about 1600 concurrent threads per server). These people use 2.2 Kernels so i dont know if the mentioned kernel and glibc patching is also relevant for me, as i am using 2.4 kernels only. Here is my problem in detail: i am using mysql-3.23.55 binary packages on linux 2.4.20 and i raised ulimit values and configuration in my.conf to allow more then 1500 threads. but when there are around 750 threads a new client connecting is told something like that (dont have the errno at the moment, i think its 11): cant create new thread, perhaps you are out of memory or there is a os-depended bug. The machine only runs apache and mysql and is a Xeon 2x2 2.4 Gz with 2 GB of RAM. cat /proc/meminfo sais that more then 1 Gig is used for caching, so memory should be no problem . Please, if you have any ideas, let me know. If it is a kernel issue, tell me to go to linux mailing lists or if its some kind of secret issue only the support will be able to answer let me know that. Thanks in advance, Philipp - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php