OpenVZ Forum


Home » General » Support » strange behavior of setrlimit or setrlimit broken in VPS?
strange behavior of setrlimit or setrlimit broken in VPS? [message #31044] Mon, 16 June 2008 07:12 Go to next message
disaster is currently offline  disaster
Messages: 158
Registered: February 2006
Senior Member
Hello!

I've recognized a strange behavior of setrlimit in VPS. I've a Script which limits some Usage of processes

     unless (setrlimit(RLIMIT_CPU, 50, 50) ) {
        print STDERR "Cannot set RLIMIT_CPU!\n";
        exit;
      }
      unless (setrlimit(RLIMIT_NPROC, 40, 40) ) {
        print STDERR "Cannot set RLIMIT_NPROC!\n";
        exit;
      }
      unless (setrlimit(RLIMIT_NOFILE, 50, 50) ) {
        print STDERR "Cannot set RLIMIT_OPEN_MAX!\n";
        exit;
      }
      unless (setrlimit(RLIMIT_OPEN_MAX, 50, 50) ) {
        print STDERR "Cannot set RLIMIT_OPEN_MAX!\n";
        exit;
      }
      unless (setrlimit(RLIMIT_DATA, 1024*1024*30, 1024*1024*30) ) {
        print STDERR "Can not extend data segment limit!\n";
        exit;
      }
      unless (setpriority(0, 10)) {
        print STDERR "Cannot set Priority!\n";
        exit;
      }

      ....

      START EXTERNAL BASH SCRIPT



This code works fine on a 1:1 Image of the VPS without OpenVZ / as running with a vanilla 2.6.25.4 Linux Kernel.

As a OpenVZ VPS i always got: "bash: xmalloc: ../bash/locale.c:68: cannot allocate 2 bytes (0 bytes allocated)" from the EXTERNAL Bash Script.

I've to rise up the "RLIMIT_DATA" up to 1024*1024*250 - then it works in VPS.

user_beancounters does not show any failures. Any ideas?

Thanks for help ideas or something else.

Stefan
Re: strange behavior of setrlimit or setrlimit broken in VPS? [message #31064 is a reply to message #31044] Tue, 17 June 2008 06:31 Go to previous message
disaster is currently offline  disaster
Messages: 158
Registered: February 2006
Senior Member
can nobody help? this is really strange.
Previous Topic: VE on GFS2
Next Topic: Iptables in HN or VE?
Goto Forum:
  


Current Time: Wed Aug 14 04:09:39 GMT 2024

Total time taken to generate the page: 0.02850 seconds