LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   setting system resource limits in CGI application (https://www.linuxquestions.org/questions/linux-software-2/setting-system-resource-limits-in-cgi-application-4175657888/)

mike_canada 07-23-2019 01:21 AM

setting system resource limits in CGI application
 
I have a test system. Its Slackware 13 with adequate global ulimits (which I can find with ulimit -a). I run apache on this system to serve my CGI files and the username that runs the CGI through apache is "nobody". My CGI runs fine.

I also have a target system which is "Damn Small Linux Not" which is knoppix and kernel 2.6.12 but its resources aren't as well configured for my needs. It uses the "Monkey" web server. It doesn't run parts of my CGI well at all, yet when I tried the same CGI code with "Damn Small Linux" with kernel 2.4.19, it works but I haven't checked the limits there.


So what I'd like to be able to do is set a high memory lock limit (from the default of 32KB for "Damn Small Linux Not" to 4096KB like I have on Slackware).

Is there a way I can do it on the active CGI user in "Damn Small Linux Not" while logged in as the root user?

scasey 07-24-2019 09:48 AM

I'm pretty sure that you can't set the limits for a user higher than the global limits set with ulimit.
Just set the ulimit as needed.

mike_canada 07-24-2019 01:06 PM

Quote:

Originally Posted by scasey (Post 6018160)
I'm pretty sure that you can't set the limits for a user higher than the global limits set with ulimit.
Just set the ulimit as needed.

Here's the crazy part.

The target machine for all the processing will eventually be a thin client with a 128MB SSD drive as a hard drive and I'm trying different flavors of linux as we speak, but for now I'm using another machine with plenty of resources.

I tried "Damn Small Linux" and it loads a 2.4 kernel. Everything is fine except the serial port implementation is broken (It names the serial port files ttyS00 and ttyS01 but they're never listed in /dev)

Now I'm using "Damn Small Linux NOT" (kernel 2.6) but it used double the space I have available for the target machine. Its serial implementation appears correct but adjusting ulimit is a pain. Its still stuck at 32K for max locked memory.

I did modify /etc/security/limits.conf to make the value higher for all users in question (root, dsl, and nobody) and I even modified a startup script manually and inserted "ulimit" commands to insert the new limits that way because I figured that would be a global limit to all processes.

To my dismay, the limit (hard and soft) is STILL stuck at 32 and the only way I can seem to adjust the limit for new processes is to put in the ulimit command before running the program, but the monkey webserver doesn't have a configuration that supports the ability for "ulimit" to be executed just before the script is run.

What other files could I modify?

It seems all the "Damn small linux" OS's are based on knoppix and I think a bit of debian.

michaelk 07-24-2019 02:41 PM

Have you tried running tinycore?

https://distrowatch.com/table.php?distribution=tinycore

mike_canada 07-24-2019 03:52 PM

Yes but now I'm sticking with "Damn Small Linux" the original. It works for everything but I just have to remember the dmesg output for the serial ports is incorrect since it adds a "0" to the dmesg but when I tested the ports with the normal name, everything works.


All times are GMT -5. The time now is 03:21 PM.