Bug #29556 [ODBC Driver 3.51]Can't create a new thread (errno 12); if you are out of.......
Submitted: 4 Jul 2007 19:03 Modified: 30 Aug 2007 16:33
Reporter: Thomas Kempster Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / ODBC Severity:S1 (Critical)
Version:3.51 OS:Windows (Server 2003 IIS6)
Assigned to: CPU Architecture:Any
Tags: Can't create a new thread, Errno 12, IIS6

[4 Jul 2007 19:03] Thomas Kempster
Description:
Hi

At random stages we are gett the error message:

ERROR [HYT00] [MySQL][ODBC Driver 3.51]Can't create a new thread (errno 12); if you are out of available memory, you can consult the manual for a possible OS dependant bug.

We only use MySQL in very basic forms for logging and some small database use for storage of very flat information, however it is Mission Critical

We have a busy web server and the main application relies on MySQL. This error happens on the server and I have to remedy the situation by running the "iisreset" command and on occasions reboot the entire server.

The application is written in VB.net, under IIS6, ASP.NET 1.1. Server is fully up to date with Win Update.

How to repeat:
Not repeatable, it is totally random.
[4 Jul 2007 20:16] Valeriy Kravchuk
Thank you for a problem report. What exact version of MyODBC do you use, 3.51.xx?
[4 Jul 2007 21:23] Thomas Kempster
Hi 

It is 3.51.12

Best Regards
[5 Jul 2007 6:38] Valeriy Kravchuk
Please, try to repeat with a newer version, 3.51.16, and inform about the results.
[5 Jul 2007 8:29] Thomas Kempster
Hi

I have now installed the latest version of the OBDC Connector, i can confirm that this is 3.51.16

I will run this today and let you know how we get on in 24 hours.

Regards
[5 Jul 2007 8:50] Valeriy Kravchuk
Please, inform about any results.
[5 Jul 2007 15:56] Thomas Kempster
Hi

Im afraid this new version has not helped, the same error has happened twice today, please help, as i said this is mission critical for us.

Best Regards
[6 Jul 2007 14:30] Thomas Kempster
Hi Valeriy

Can you help us on this, alternatively is there a support number I can call for assistance.

Best Regards
Tom
[6 Jul 2007 21:26] Sveta Smirnova
Thank you for the feedback.

You indicated version of the server is 5.0.17 which is quite old. Please upgrade to version 5.0.37, try with it and say us result. Please don't upgrade to the latest version, because it is affected by bug #20815.

Also error 12 is "Out of memory" error. Please indicate how much physical RAM do you have and provide your configuration file.

> alternatively is there a support number I can call for assistance.

You can find information about support which MySQL provides and how to get it at http://www.mysql.com/support/
[7 Jul 2007 10:13] Thomas Kempster
Hi

Thanks for your response, 4GB of Physical RAM, 2 x Dual Core 2.8 Xeons with HT.

Please see attached MY.ini

Regards
[7 Jul 2007 10:23] Thomas Kempster
Hi

I have purchased MySQL Netowrk basic in feb 2006.

Can you please tell me where to upgrade and also, how to contact someone.

I cannot find a UK contact number. Please help me...

Regards
[7 Jul 2007 15:05] Sveta Smirnova
Thank you for the feedback.

Please also upgrade to version 5.0.37 or 5.0.36, try with it and say us result.
[7 Jul 2007 15:08] Sveta Smirnova
About your support contract.

I notified our Support Customer Relations Specialists about your problem. They should contact with you soon.

Also you can use form at http://www.mysql.com/company/contact/
[7 Jul 2007 16:51] Thomas Kempster
Can you tell me where I can download the correct version.

Regards
[7 Jul 2007 17:25] Sveta Smirnova
Version 5.0.37 you can download at http://downloads.mysql.com/archives.php?p=mysql-5.0&v=5.0.37 and version 5.0.36 you can download at http://enterprise.mysql.com/
[9 Jul 2007 20:54] Thomas Kempster
Hi,

I havent upgraded the version yet.

I have noticed that the server crashes at about 1506 sleeping threads.

When i run SHOW PROCESSLIST it shows this number everytime before crashing.

Why are the sleeping.

How can i stop these from sleeping and make them reusable? I have ensured that all my .NET code is ending and killing connections.

Thanks
[10 Jul 2007 8:04] Sveta Smirnova
You can play with '%timeout%' options. See also http://dev.mysql.com/doc/refman/5.0/en/mysqld-option-tables.html
[14 Jul 2007 11:18] Thomas Kempster
Hi All

I have found a work around to this problem and I am willing to share it with you. WARNING; This is NOT a sure fast solution (It may not work with your system) and I am going to keep raising this with MySQL to get my system running smoothly.

I did the following to stop my system crashing repeatedly:

1. Added the following line to the my.ini file - wait_timeout=460
  a. The normal is something silly like 28700 and is not set by default in the my.ini file until/unless you add it in.
2. Increased my max connections to 2000 (Think carefully if your server can handle the set amount before you set it to any level, search Google for suggestions)
3. Restarted IIS - cmd > iisreset
4. Restarted the MySQL Service - Services.msc > Restart MySQL 5.0

This now kills any sleeping connections that reach the age of "460".

My server now runs fine and ends these "Sleeping" connections. You can see this in action by running the "SHOW PROCESSLIST" command and watching the age of the thread.

If anyone knows why ASP.NET v1.1 when it closes a DB connection, MySQL "Sleeps" it and does not "Kill" it, I would love to know.

Regards
Anthony
[14 Aug 2007 12:04] Susanne Ebrecht
fix version number
[14 Aug 2007 15:10] Thomas Kempster
Hi

Susanne, can you explain what your last comment means?

Regards
Anthony
[14 Aug 2007 19:26] Susanne Ebrecht
Hi,

of course. 
This bug is signed as MyODBC bug. You used MyODBC version 3.51.xx.

But in the header of the bug report there was written version 5.xx, because you use the server version 5.xx.

Only by accident, I found this bug because of the wrong version number.

I just changed the version number to 3.51 because that the right version of this MyODBC bug and with this number it won't get lost.
[28 Aug 2007 11:21] Tonci Grgin
Hi Thomas.

> If anyone knows why ASP.NET v1.1 when it closes a DB connection, MySQL "Sleeps" it and does not "Kill" it, I would love to know.

I presume this is due to pooling. Can you please confirm pooling has been disabled on all levels involved?
[30 Aug 2007 16:33] Tonci Grgin
Hi Thomas. I am sorry I missed original problem report in Bug#28387. Please see discussion and solution there.