LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-04-2019, 03:43 PM   #1
tomislav91
Member
 
Registered: Apr 2012
Posts: 46

Rep: Reputation: Disabled
i limit .exe file but at the end its not limited


I am using ubuntu 14.04
I am having a some sh script which contains

Code:
export __GL_THREADED_OPTIMIZATIONS=1
export GPU_MAX_HEAP_SIZE="100"
export GPU_MAX_ALLOC_PERCENT="100
cpulimit -l 20 wine MyProgram.exe
When i list
Code:
 ps ahux --sort=-c | awk 'NR<=5{printf"%s %6d %s\n",$3,$2,$11}'
i get more than 20, go to 30 percent
WHere am I wrong? I also added in visudo
Code:
%sudo   ALL = (ALL) NOPASSWD: /usr/bin/cpulimit
just to get rid of sudo user and so on.
My .exe consume more cpu. Don't know really why, and tried to limit, but no help.
 
Old 03-04-2019, 05:56 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Without really knowing the details of how cpulimit operates and how ps measures or reports CPU utilization:

cpulimit seems to work by stopping and continuing a process with signals. This is a crude method that can’t yield very precise results in my opinion. For example, it heavily depends on the overall CPU load how quickly cpulimit can send the signal, and how quickly the signal is delivered. Another factor: The wine process might not always be in a state that permits it to react to a stop signal. I’d say that in your case, getting 20% to 30% is not bad at all.

Have you tried launching cpulimit with a lower number?

A more sophisticated and probably finer-grained method of controlling CPU usage is cgroups.
 
Old 03-04-2019, 06:08 PM   #3
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,744

Rep: Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222
As I understand it,
Code:
cpulimit -l 20 wine MyProgram.exe
is limiting the cpu available to wine, not to MyProgram.exe.
 
Old 03-05-2019, 01:43 AM   #4
tomislav91
Member
 
Registered: Apr 2012
Posts: 46

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by scasey View Post
As I understand it,
Code:
cpulimit -l 20 wine MyProgram.exe
is limiting the cpu available to wine, not to MyProgram.exe.

in fact yes, i limit my .exe which i run with wine, so yeah, wine is affect limiting.
Is this ok? Is there a better method for doing it?
I find this,but not seems to give results.
 
Old 03-05-2019, 10:49 AM   #5
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,744

Rep: Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222
Quote:
Originally Posted by tomislav91 View Post
in fact yes, i limit my .exe which i run with wine, so yeah, wine is affect limiting.
Is this ok? Is there a better method for doing it?
I find this,but not seems to give results.
I think you missed my point. It's not the .exe that's being limited at all. It is wine that's being limited. wine is not affecting limiting...it is the program being limited.

Have you compared the cpu usage with and without cpulimit? Is there no difference at all?

Have you tried using the -v verbose option to see what's happening?
 
1 members found this post helpful.
Old 03-05-2019, 11:07 AM   #6
tomislav91
Member
 
Registered: Apr 2012
Posts: 46

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by scasey View Post
I think you missed my point. It's not the .exe that's being limited at all. It is wine that's being limited. wine is not affecting limiting...it is the program being limited.

Have you compared the cpu usage with and without cpulimit? Is there no difference at all?

Have you tried using the -v verbose option to see what's happening?

now i think u are right. A slight difference. I red somewhere that wine use only 1 core, maybe that is issue, don't know really.


So it reach to 40%, even if I limit it to 20. Also you can see that I tried to use nice and give a more priority but no affect at all.
My program is working slowly and can freeze a sec and come back and so on. Cpu goes very high..
Attached Thumbnails
Click image for larger version

Name:	Untitled.png
Views:	90
Size:	2.1 KB
ID:	30020  
 
Old 03-05-2019, 12:30 PM   #7
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,744

Rep: Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222
Quote:
Originally Posted by tomislav91 View Post
[snip]
My program is working slowly and can freeze a sec and come back and so on. Cpu goes very high..
That's how cpulimit works: from man cpulimit
Code:
       ·   cpulimit  always  sends  the  SIGSTOP and SIGCONT signals to a process, both to verify
           that it can control it and to limit the average amount of CPU it consumes.   This  can
           result  in  misleading  (annoying) job control messages that indicate that the job has
           been stopped (when actually it was, but immediately restarted).  This can  also  cause
           issues  with  interactive  shells  that detect or otherwise depend on SIGSTOP/SIGCONT.
 
Old 03-06-2019, 01:49 AM   #8
tomislav91
Member
 
Registered: Apr 2012
Posts: 46

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by scasey View Post
That's how cpulimit works: from man cpulimit
Code:
       ·   cpulimit  always  sends  the  SIGSTOP and SIGCONT signals to a process, both to verify
           that it can control it and to limit the average amount of CPU it consumes.   This  can
           result  in  misleading  (annoying) job control messages that indicate that the job has
           been stopped (when actually it was, but immediately restarted).  This can  also  cause
           issues  with  interactive  shells  that detect or otherwise depend on SIGSTOP/SIGCONT.
this start to happend before i use cpulimit
 
Old 03-07-2019, 01:51 AM   #9
tomislav91
Member
 
Registered: Apr 2012
Posts: 46

Original Poster
Rep: Reputation: Disabled
I tried maybe to remove cache memory in cron job

Code:
#!/bin/bash
echo 3 > /proc/sys/vm/drop_caches && swapoff -a && swapon -a
constantly i have a problem that just that exe app cause to slow down, freeze, and so on. Bandwidth is ok, no problem to that side.
 
Old 03-07-2019, 02:18 PM   #10
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
^ and why would you want to do that?

dropping caches certainly won't improve performance.

Quote:
Originally Posted by berndbausch View Post
cpulimit seems to work by stopping and continuing a process with signals. This is a crude method that can’t yield very precise results in my opinion. For example, it heavily depends on the overall CPU load how quickly cpulimit can send the signal, and how quickly the signal is delivered. Another factor: The wine process might not always be in a state that permits it to react to a stop signal. I’d say that in your case, getting 20% to 30% is not bad at all.

Have you tried launching cpulimit with a lower number?

A more sophisticated and probably finer-grained method of controlling CPU usage is cgroups.
totally agree.
i'm using cpulimits, but it's really not precise at all.
personally, i'm not going to start with cgroups for one single application that regularly gets my cpu fans spinning... crude is sufficient.

that said, i'm not sure it's a good idea to use that with wine.

tomislav91, why do you need to limt that program?
 
Old 03-07-2019, 05:52 PM   #11
tomislav91
Member
 
Registered: Apr 2012
Posts: 46

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
^ and why would you want to do that?

dropping caches certainly won't improve performance.

totally agree.
i'm using cpulimits, but it's really not precise at all.
personally, i'm not going to start with cgroups for one single application that regularly gets my cpu fans spinning... crude is sufficient.

that said, i'm not sure it's a good idea to use that with wine.

tomislav91, why do you need to limt that program?
i know that i maybe have a better option for using this app, but right now i am stuck with it and need to solve this issue of getting cpu at 100%
Look just one little period

I maybe dont need to limit it but dont have solution for being cpu so busy cause this app. I am sure that in app is not problem, within system is. I tried with new ubuntu 18 and ddr4 4gb ram and it is the same, so its strange, it looks that app is problem, but it is not, cause i am having problem on several workstation. internet is also good.
Don't have idea what to try to improve...
Attached Thumbnails
Click image for larger version

Name:	ff.jpg
Views:	67
Size:	64.9 KB
ID:	30043  
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SQUID Block exe file from https://*****.com/****.exe aamdevan Linux - Server 3 12-05-2013 02:15 AM
cygwin g++-3.exe, gcc-3.exe corrupted to g++3.exe.dam and gcc-3.exe.dam pawanjanbandhu Linux - Newbie 2 12-03-2009 11:27 AM
cygwin g++-3.exe, gcc-3.exe corrupted to g++3.exe.dam and gcc-3.exe.dam pawanjanbandhu Linux - Software 1 11-17-2009 02:26 PM
samba compatibility with microsoft srvtools.exe (usrmgr.exe and srvmgr.exe) checkmate3001 Linux - Software 1 09-06-2008 05:08 AM
SETUP.EXE/autorun.exe don't run in wine mst3kman Linux - Games 3 01-22-2006 02:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration