Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Running make with limited CPU
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Running make with limited CPU

I am trying to compile some code in my LES VPS and always ended up with the errror below:

collect2: error: ld terminated with signal 9 [Killed]

I know this is because the CPU is limited in LES (which is expected) but I am just wondering if there is any way I can sort of compile it in a nice way so that it could use limited CPU (even if the compiling takes longer. I tried to use nice -9 make with no luck.

Comments

  • jarjar Patron Provider, Top Host, Veteran

    Not sure but cpulimit might do the trick.

    http://www.cyberciti.biz/faq/cpu-usage-limiter-for-linux/

  • @jarland said:
    Not sure but cpulimit might do the trick.

    http://www.cyberciti.biz/faq/cpu-usage-limiter-for-linux/

    Doesn't seem to work:

    Warning: no target process found. Waiting for it...
    Process 31641 detected
    Process 31641 dead!
    
    collect2: error: ld terminated with signal 9 [Killed]
    
  • i believe this is a ram/swap issue.
    i tried compiling znc on my LES instance, and it failed.
    not sure how to fix it.

  • @darkshire said:
    i believe this is a ram/swap issue.
    i tried compiling znc on my LES instance, and it failed.
    not sure how to fix it.

    I beg to differ, I used to compile the same package without issue on other 128MB RAM VPS (OpenVZ as well) but I think LES actually is more restrictive in terms of CPU due to the low price.

  • jarjar Patron Provider, Top Host, Veteran

    Well typically when you run out of memory is when things start dying unless he's got some automation to kill -9 anything at a certain point of CPU usage. Maybe check /proc/user_beancounters for failcounts?

  • @jarland said:
    Well typically when you run out of memory is when things start dying unless he's got some automation to kill -9 anything at a certain point of CPU usage. Maybe check /proc/user_beancounters for failcounts?

    i have not set up anything like this myself, and this is running on a clean install of ubuntu 12.04 x64;
    we will have to wait for anthony to respond about the possible "CPU abuse" "issue" of compiling.

  • @zhuanyi said:
    I am trying to compile some code in my LES VPS and always ended up with the errror below:

    collect2: error: ld terminated with signal 9 [Killed]
    

    If you can find what is killing your linker, it will be easier to suggest a solution. However, my guess is also on running out of memory. Here is an interesting article on how to use gcc on low memory vps,

    http://hostingfu.com/article/compiling-with-gcc-on-low-memory-vps

    Also, I notice that the linker gets killed and not the compiler. So, you are able to compile source into objects just fine but when you try to link them, this happens ?

    Thanked by 1darkshire
  • You could always use distcc on your local machine or another VPS - https://code.google.com/p/distcc/

    Thanked by 2zhuanyi Amitz
  • @dg51 said:

    good link, thanks, but it seems make.conf is only apart of gentoo/emerge.
    /etc/make.conf does not exist on debian or centos

  • @jarland said:
    Well typically when you run out of memory is when things start dying unless he's got some automation to kill -9 anything at a certain point of CPU usage. Maybe check /proc/user_beancounters for failcounts?

    Seems you are right:

     numproc                        15                   48  9223372036854775807  9223372036854775807                    0
                physpages                   25143                32783                    0                32768                    2
                vmguarpages                     0                    0  9223372036854775807  9223372036854775807                    0
                oomguarpages                 4153                14720  9223372036854775807  9223372036854775807                    1
    
  • @manacit said:
    You could always use distcc on your local machine or another VPS - https://code.google.com/p/distcc/

    Interesting...so essentially the program somehow "read in" the environment to another VPS?

  • Already run cmake to compile hiawatha web server - work with any prometeus and ramhost.us vps

    yes i make this with 50cent VPS from prometeus - reliable stable you name it.

  • @darkshire said:

    good link, thanks, but it seems make.conf is only apart of gentoo/emerge.
    /etc/make.conf does not exist on debian or centos

    You don't have to use /etc/make.conf. That is required only if you need to change it permanently. You can modify the CFLAGS in your makefile directly since this is a gcc option.

    After modifying your makefile, make sure gcc commands are run with the specified params similar to how it has been manually run below,

    $ cat > 1.c
    int main(void){ return 12; }
    $ gcc --param ggc-min-expand=0 --param ggc-min-heapsize=8192 1.c
    $ ./a.out; echo $?
    12
    

    Hope this helps.

    Thanked by 1nocom
  • inklightinklight Member
    edited November 2015

    @dg51 said:

    I'm facing same issue I aded abouve code and no change . my issue related to ffmeg sorrce compiling this is contents of make file

  • necro post

Sign In or Register to comment.