on 2013 May 31 10:37 AM
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
Request clarification before answering.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you have any processes that are crashing? Those are the leading candidates for leaking SYSV semaphores.
You can check ipcs -p
to get a list of the currently allocated semaphores on the system, and see which username / process id has them allocated. You can use ipcrm -s semid
to remove unneeded semaphores on the system to try and avoid rebooting.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
...and the forum admins themselves might have further clues - cf. the maintenance log...
ipcs -p does not give usefull info. Better: http://unix.stackexchange.com/questions/75547/how-to-get-proccesses-currently-running-semaphores-by-...
Looks like it's the java process which causes the semaphores to be "lost". But which part of the jvm is then the question
User | Count |
---|---|
50 | |
9 | |
8 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.