we have two servers with ASA 18.104.22.16879 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
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
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