Hello, we have two servers with ASA 11.0.1.2879 installed. One is a debian 6.0.7, the other a ubuntu 12.04 LTS. Beside the ASA dbserver (64bit) we run 1-2 tomcat 7.0.27 (64bit too) instances which connect to the SQL Anywhere via the sajdb.jar interface. On both servers we have every 1-2 months the message that the system is running out of SYSV semaphores Failed to obtain DB connection from data source 'myDS': java.sql.SQLException: Could not retrieve datasource via JNDI url 'java:comp/env/jdbc/dbname' java.sql.SQLException: [Sybase][ODBC Driver][SQL Anywhere]Connection error: Insufficient system resources - failed to allocate a SYSV semaphore [See nested exception: java.sql.SQLException: Could not retrieve datasource via JNDI url 'java:comp/env/jdbc/dbname' java.sql.SQLException: [Sybase][ODBC Driver][SQL Anywhere]Connection error: Insufficient system resources - failed to allocate a SYSV semaphore] Is there a way to know which process is eating up the SYSV semaphores ? Once this occurs we have to reboot the server, nothing else we tryed did help asked 31 May '13, 09:37 ASchild |
SQL Anywhere client libraries and servers use SYSV semaphores on most Unix platforms (Solaris is an exception). The semaphores are used to perform signalling actions across client and server processes. There are a number of ways that semaphore can be 'leaked':
There are possibly other ways that semaphores can be leaked but the above are the most common tha twe have seen. For example:
I am not that familiar with Tomcat so I do not know if any of the above applies to your situation. If you are running Tomcat within an Apache process then the first known issue could be what is causing your semaphore leak. FWIW: We have had discussions within SA engineering about possible method(s) of working around the above known issues. Many times we are able to work with the application developer(s)/customers to resolve the issue by having their application modified (e.g. correct their signal handlers to chain handlers). Sometimes there isn't any better solution other than to ensure that the semaphores periodically get cleaned up by a process that monitors the number of semaphores in use and then performs a clean up process when the limit is near. I.e. To clean up: (a) stop the Apache/httpd server, (b) delete all semaphores owned by the user that run Apache, and then (c) restart the Apache/httpd server. answered 31 May '13, 14:54 Mark Culp We use the tanuki service wrapper for tomcat. The instances are terminated each night and restarted. I have the feeling that internally it uses something like kill -s 9 when the jvm does not terminate in a "timely" fashion... I will dig deeper in that direction. Thanks
(31 May '13, 16:53)
ASchild
|
Do you have any processes that are crashing? Those are the leading candidates for leaking SYSV semaphores. You can check answered 31 May '13, 10:00 Jeff Albion 1
...and the forum admins themselves might have further clues - cf. the maintenance log...
(31 May '13, 10:47)
Volker Barth
ipcs -p does not give usefull info. Better: http://unix.stackexchange.com/questions/75547/how-to-get-proccesses-currently-running-semaphores-by-proc Looks like it's the java process which causes the semaphores to be "lost". But which part of the jvm is then the question
(31 May '13, 11:24)
ASchild
|