Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am a newbie to a number of technologies here, so i am seeking the kind of answers that are very detailed .
Background:
I have a FreeRadius/Postegresql installation that crashed at some point; reason to be that, Postegresql would not start, the error displayed was ...
Quote:
FATAL: could not create semaphores: No space left on device
(The issue was resolved by increasing the semaphore limits ).
Now, what does it mean exactly
Quote:
System V semaphores
I googled this a little bit but always this term comes mentioned in some advanced programming context, I would like to understand what does it mean but in the context that i have mentioned above.
Semaphores are a programming concept, not necessarily advanced. The wikipedia page on semaphores overview them well.
The important part there is that there was no space left and by adding higher limits, using more memory for this application, you were able to resolve the problem. Software applications report problems when they run out of available resources or memory, and these reports can vary when you reach system limits.
Other limits in Linux are things like the number of processes or the number of files allowed on a system which can be changed for applications where there are a number of concurrent processes running or if an application needs a number of open files in order to run. In this case, semaphore were being used, which is just another limit.
Therefore another resource to understand are the limits.conf where some of the system maximums are configurable.
... and the key rationale for these limits is to avoid, say, "fork()-bombing," whether intentional or accidental. If your innocentlybuggy program goes into a loop acquiring semaphores or spawning processes or gobbling memory or what-have-you, it must be stopped before it impacts the system as a whole. (And, so that you can recognize that the problem exists(!), and fix it.)
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
Relational data base managers (RDBMS) make use of semaphores (and messages too) to insure that multiple users (or processes) do not clash when updating a table; the idea is the same as semaphores on railroads so that two trains do not use the same section of track at the same time, one waits, the other goes.
You may want to look at any applications you've written to see how many updates are happening at any given time rather than simply increasing the number of semaphores. PostgreSQL handles collisions pretty well (as do MariaDB/MySQL) but it's more or less up to you to do updates serially in your application software. Look to see if you have multiple processes updating the same table at the same time and consider using a single function to do the updates (or inserts or deletes) which will give the DBMS a better chance at not running out of semaphores. Also, if you've use semaphores in your programming but sure that when a semaphore has completed that it release the semaphore so you don't get overflow.
Have a look at what the [I]ipcs/I] utility show you. On a quiescent system (mine) you'll see something like this
Code:
ipcs
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 1443004416 trona 600 393216 2 dest
0x00000000 1443037185 trona 600 393216 2 dest
0x00000000 1443069954 trona 600 393216 2 dest
0x00000000 1443102723 trona 600 393216 2 dest
0x00000000 1443266564 trona 600 393216 2 dest
0x00000000 1443495941 trona 600 393216 2 dest
0x00000000 2010152966 trona 600 393216 2 dest
0x00000000 2010251271 trona 600 393216 2 dest
0x00000000 2012446728 trona 600 393216 2 dest
0x00000000 1448345609 trona 600 524288 2 dest
------ Semaphore Arrays --------
key semid owner perms nsems
0xcbc384f8 44204035 trona 600 1
------ Message Queues --------
key msqid owner perms used-bytes messages
Those semaphore arrays are managed by MariaDB in this case -- if you see a whole lot of them, that's a hint to look deeper, and, of course, simply increasing the size of space you need might be the right answer but so may looking into how you are updating from multiple processes.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.