Cspeed: increase system responsiveness using cgroups

Recently, there was a much-discussed kernel patch that grouped processes by the TTY/terminal they were started from so your system got extremely responsive under pressure. Then, a .bashrc implementation was made that effectively does the same thing in only a couple lines of code. I decided to take that implementation (as modified at WebUpd8) and put it in a bash daemon with options.
How it works:
Linux 2.4 added a feature called "cgroups" which let you limit the resource usage of processes by prioritization, isolation, etc. For more information, see the Wikipedia article and the ArchWiki article on it. This script uses the WebUpd8 version of a bashrc modification that uses cgroups to increase your system's responsiveness under lots of pressure (for example, compiling a kernel with 'make -j64'). Note that it WILL NOT work for processes launched from X, like in your desktop environment. You'll need to open up a new terminal window or switch to a different TTY to see a difference in responsiveness.
Instructions:
After installing, if you use Arch Linux, add "cspeed" to your daemons array in /etc/rc.conf. Then, add the following line per-user in /home/user/.bashrc or system-wide at /etc/bash.bashrc:
/bin/bash /etc/bash.cgroups
Download:
AUR: http://aur.archlinux.org/packages.php?ID=43873
Github: https://github.com/sloshy/cspeed
Any bugs, suggestions, anything would be greatly appreciated !
Last edited by Sloshy (2010-12-01 18:01:29)

hbekel wrote:It seems you wanted to provide an easy way of enabling cgroups. That's ok of course, but it's not really the arch way. I personally wouldn't use it. Setting up cgroups isn't that hard after all, it's just a few lines...
Yeah, it's not so hard. This is more for the lazy people who don't want to modify this on their own and get it up-and-running quickly without any PEBKAC errors.
hbekel wrote:
Here are some problems I see:
- Modifying system wide config files... ouch. A big no no, at least for me. This type of hand-holding just isn't arch. Especially when you're adding to /etc/rc.local when you should at least have used an rc-script for that.
I'm going to be honest here: I'm rather new to Linux. I've only used it for a few years now, and I've used Arch for less than one. So, I wasn't sure what those were until you mentioned them right now. I'll transition it to an rc-script over the weekend.
hbekel wrote:- Dynamically creating/deleting a script below /usr/local/sbin without obvious reasons: the file is static, so it could simply be distributed (with the benefit of being properly tracked by a package manager). Note that the use of /usr/local/* is discouraged. No sane arch package installs anything there, and no arch user expects anything there unless he put it there himself.
Yeah, I'll fix that. I wasn't thinking when I made my script and didn't just pre-make this file. Thanks for pointing this out!
hbekel wrote:- Testing for a verbatim line in a config file to determine whether you need to edit it isn't very reliable... what if the user accidently leaves a space somewhere on your "test line" while editing the file later on? (Interestingly, you could have tested for the existence of the cgroup_clean script, which could have justified creating it dynamically... but that would've been a hack as well)
Hmm, good point. Maybe I could append "#cspeed" before the lines that are supposed to be there; would that work?
hbekel wrote:- Using inplace editing with sed to remove those changes is just... creepy. I'd never sed -i any important file, let alone a system config file.
Yeah, this has the potential to screw up badly. As I just said, maybe "#cspeed" could help with that.
hbekel wrote:Some bugs/oversights: It seems you forgot a ">>" on line 80, at least that seems to be your intent there. The undo function also edits /etc/skel/.bashrc, which you never touch during -s.
Good call! I did forget that; my mistake. And As for the /etc/skel/.bashrc edit, that was also a mistake; an earlier version of the script, before I pushed it to github, modified each individual user's .bashrc (and set it as the default for all new users) which, as you can imagine, is super messy. I'll remove the lines you mention .
Thank you so much for your comments; I'll fix my script up right away!
Last edited by Sloshy (2010-11-26 18:05:56)

Similar Messages

  • [32282.000367] firefox:2114 freeing invalid memtype c02f2000-c0302000 I get this from system log using latest version of Firefox: What kind of problem is this?

    I get this from system log using latest version of Firefox:
    [32282.000367] firefox:2114 freeing invalid memtype c02f2000-c0302000
    What kind of problem is this?
    Anyway Firefox seem to be working correct. I would like to be sure that it'snt a security problem.

    Thanks a lot for your swift response. And sorry if it was a bit too hectic to go through my detailed query (which I did because it was misunderstood when I asked previously). As I've mentioned above, I was informed that updating to 5.0.1 would '''require''' me to '''delete''' the current version and then install the new one. And doing so will involve losing all my bookmarks. I guess I should have been more specific and detailed there. By losing, I didn't mean losing them forever. I'm aware that they're secured in some place and deleting and installing the software doesn't harm its existence. What I meant that if I install the new version, I'd have to delete the old one. And after installing the new version, I'd have to transfer them (bookmarks) back from wherever they are. Get it? When it updated from 3.6.9 to 3.6.13, and from 3.6.13 to 3.6.18, I didn't need to follow that process. They were already present on their own.
    BTW, I'm having no problems with 3.6.18 but after learning about the existence of version 5.0.1, I'm a bit too eager to lay my hands over it.
    Thanks for your help; hope this wasn't extremely long.

  • Which legacy systems are used for what purpose?

    Hi gurus,
    I tried looking in this forums, but couldnt gather much information on which legacy systems are used and for what purpose? <b>can any body send me a link that can help me understand when and where, which systems are used for what purpose..</b> I have a general understanding of Legacy systems so i am not looking for terminology explanation,  i would appreciate any thing that is related to business and explains the purpose.
    thanks,
    kishore karnati

    Hi,
    Term legacy system means tailor made system by group of software developer or any branded software which deals with the group requirement  like tally we user for finance.
    Legacy system can be based on any technology like visual basis as front end and oracle as back end or Developer 2k as front end and oracle as back end. For report most of the legacy system we have seen uses crystal report.
    You can develop and implement based on the requirement from the user though you need to define some specify process to keep the system streamline which is in your hands.
    Concept like devlopment/quality/production we don't have that verys strict concept.
    More and more they are not intergrated each other functionally mean lets say inventory has come to the godown then your vendor outstanding should increase in finance which does not happens you need to key in the seperate value for it.
    Hope this helps!!!

  • System response is poor...  Everything takes longer to perform..

    Hi, I can't say when for sure it happened but sometime either immediately after I moved to 10.5, Leopard last October, or perhaps since updating first to 10.5.1 and then to 10.5.2, my system response has slowed considerably... Both booting the machine (MacBook Pro 17 inch with dual 2.16 GHz processors and 2 Gbytes of RAM) and shutting it down take significantly longer than it used to... Booting takes maybe a full 2 minutes... Also, opening applications is slower too... The spinning beach ball is an all too often seen utility...
    Can anyone suggest anything that might be going on??? Are there some certain memory caches that might be safely emptied that might improve performance??? I have the Onyx utility and it lists a ton of caches that one can empty if desired but I am afraid of doing so without knowing what impact emptying any of those caches might have!! Anybody with any ideas??? Any help would be much appreciated... thanks... bob...

    We don't support performing any action except email notification in case of alert from App Insight. 
    To integrate with
    MS Alarm/MS ticketing  (
    GFS ) you’d need parse the mails from AI and use the
    MS Alarm/MS ticketing  (
    GFS )  connector to create a ticket. 
    Mihail Smacinih

  • Increase system font size ?

    Just bought a new imac 27". I find the system font size way too small and very stressful to my eye. Did quite some search on how to increase the font. It appears that there is no way to increase system font in OS X ? That really ***** big time.

    Hello font2small_imac27 & welcome to the forums...
    It appears that there is no way to increase system font in OS X
    These options all work work for me on my iMac:
    • Finder menu/View (or right click on Desktop) Show View Options....you can choose from 10pt to 16pt there.
    • A typical method is to change the display's resolution... As well, in System Preferences/Appearance there is an option to [√] Use LCD font smoothing when available.
    • You can change the text/viewing bigger/smaller in certain applications, such as Safari ( http://www.apple.com/safari/features.html ).
    • You can also go to System Preferences/Universal Access/Seeing and apply 'Zoom' there.
    • Using the 'Help' menu in the Finder, type in text size and follow the documentation available there.
    • Use the menu/tab at the top for 'Downloads' to see what if any 3rd party applications are available - be certain they are fully compatible w/Snow Leopard or don't bother.
    • Details on various options for menus, etc. around the OS can be studied here: http://www.ehow.com/how4516828adjust-icon-size-desktop-preferences.html
    You might want to take a class at your nearest Apple Store for new users to help get the most out of your new iMac.

  • CacheRefreshException: Connection to system RUNTIME using application...

    Hi experts,
    I have a following problem: SXI_CACHE is not functioning with following message.
    com.sap.aii.ib.server.abapcache.CacheRefreshException: Connection to system RUNTIME using application RUNTIME lost. Detailed information: Error accessing "http:<xihost>:80xx/run/hmi_service_id_fresh_swcv/int?container=any" with user "XIDIRUSER". Response code is 404, response message is "Not Found".
    I have checked users, passwords and roles - everything looks ok. RFC connections too. It is about Netweaver 2004s (SP09) Java stack restart. I tried many Sap notes, but have not found nothing eficient.
    It seems to me, that port shall be in range 5xx00 not 80xx. Manually, I have tried 5xx00 port in broser and it works.
    Integration Engine (ICM) port was in range 5xx00 which I have changed to 80xx (in TC SMICM, Exchange profiles and SLD) according to recomendations. All this started to happen after J2EE Stack restart.
    Why is it pooling wrong port ?
    Regards
    Jurica

    FYI
    In mean time we found the problem:
    On of exchange Profile parameters (com.sap.aii.connect.integrationserver.httpport) was set to wrong port - to 80xx instead of 5xx00. After Java Stack restart from SMICM, everything was ok again.
    So, this is actually Java Stack port parameter,  com.sap.aii.connect.integrationserver.r3.httpport is ABAP Stack port.
    Regards
    jurica

  • Connection to system REPOSITORY using application REPOSITORY lost.

    Connection to system REPOSITORY using application REPOSITORY lost. Detailed information: Error accessing "http://<host>:<port>/rep/query/int?container=any" with user "USER01". Response code is 401, response message is "Unauthorized".
    USER01 is locked, but i want to change this conection user to PIDIRUSER.
    Do you know where this connection user can be changed?

    Hello there.
    Please check the note below according to your system:
    #999962 - PI 7.10: Change passwords of PI service users
    #936093 - XI 7.0: Changing the passwords of XI service users
    #721548 - XI 3.0: Changing the passwords of the XI service users
    Regards,
    Caio Cagnani

  • Connection to system REPOSITORY using application REPOSITORY lost. Detailed

    Connection to system REPOSITORY using application REPOSITORY lost. Detailed information: Error accessing "http://ECC:50000/rep/query/int?container=any" with user "PIDIRUSER". Response code is 401, response message is "Unauthorized"

    This problem occurs when user is locked. Unlock yhe user in su01.
    unable to access repository / SLD
    See this guide may help you.
    https://www.dw.dhhs.state.nc.us/wi/OnlineGuides/EN/ErrorsEN.pdf
    Rewards if helpful.
    BR,
    Alok

  • Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system. I have a wndiws 7 system and use a Intel core processor. I have restarted several times and still ge this

    Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system. I have a wndows 7 system and use a Intel core processor. I have restarted several times and still ge this error. I have also tried to reinstall firefox and get the same error
    == This happened ==
    Every time Firefox opened
    == today ==
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MDDS; InfoPath.2; .NET4.0C; AskTbUT2V5/5.8.0.12304)

    <u>'''Kill Application'''</u>
    In Task Manager, does firefox.exe show in the <u>'''Processes'''</u> tab?
    See: [http://kb.mozillazine.org/Kill_application Kill Application]
    '''<u>Causes and solutions for Firefox hanging at exit:</u>'''
    [[Firefox hangs]]
    [http://kb.mozillazine.org/Firefox_hangs#Hang_at_exit Firefox hangs at exit]
    [[Firefox is already running but is not responding]]
    <u>'''Safe Mode'''</u>
    You may need to use '''[[Safe Mode]]''' (click on "Safe Mode" and read) to localize the problem. Firefox Safe Mode is a diagnostic mode that disables Extensions and some other features of Firefox. If you are using a theme, switch to the DEFAULT theme: Tools > Add-ons > Themes <u>'''before'''</u> starting Safe Mode. When entering Safe Mode, do not check any items on the entry window, just click "Continue in Safe Mode". Test to see if the problem you are experiencing is corrected.
    See:
    '''[[Troubleshooting extensions and themes]]'''
    '''[[Troubleshooting plugins]]'''
    '''[[Basic Troubleshooting]]'''
    If the problem does not occur in Safe-mode then disable all of your Extensions and Plug-ins and then try to find which is causing it by enabling <u>'''one at a time'''</u> until the problem reappears. <u>'''You MUST close and restart Firefox after EACH change'''</u> via File > Restart Firefox (on Mac: Firefox > Quit). You can use "Disable all add-ons" on the Safe mode start window.

  • HT1206 I need a work iTunes account for my work system, but used my work email address as an associated email to my personal iTunes account. Now I can't use the work email to create the new iTunes account.  how do I remove the email from my personal accou

    Since I upgraded to Mavericks from Snow Leopard I need a work iTunes account for my work system, but used my work email address as an associated email to my personal iTunes account.
    Now I can't use the work email to create the new iTunes account.  how do I remove the email from my personal account?

    You can long into an account via this page and update the email addresses that you have on it : http://appleid.apple.com

  • System copy using SAPInst(Export Import database Independent prcoess failed

    Hello ,
    I am doing a System copy using SAPInst export/import process .
    Source system : SAP Netweaver'04( BW 3.5 , Kernel : UC 640 ,Patch level 196 )
    Export process fails at Phase 2 -  Database Export at R3load jobs running 1,waiting 0 . Below is the log details
    SAPSDIC.log
    (EXP) INFO:  entry for BAPICONTEN                        in DDNTT is newer than in DDNTT_CONV_UC: 20040211101817 > 20000621155733
    (EXP) INFO:  entry for BAPICONTENT255                    in DDNTT is newer than in DDNTT_CONV_UC: 20040211101817 > 20031127161249
    (EXP) INFO:  entry for BAPICONVRS                        in DDNTT is newer than in DDNTT_CONV_UC: 20040211101817 > 20010131174038
    (EXP) INFO:  entry for BAPICREATORDATA                   in DDNTT is newer than in DDNTT_CONV_UC: 20040211101817 > 20000621155733
    (EXP) INFO:  entry for BAPICRMDH1                        in DDNTT is newer than in DDNTT_CONV_UC: 20051229175654 > 20031211120714
    (EXP) INFO:  entry for BAPICRMDH2                        in DDNTT is newer than in DDNTT_CONV_UC: 20051229175654 > 20031211120714
    (EXP) INFO:  entry for BAPICRMEXP                        in DDNTT is newer than in DDNTT_CONV_UC: 20051229175513 > 20031211120627
    (EXP) INFO:  entry for BAPICRMEXT                        in DDNTT is newer than in DDNTT_CONV_UC: 20051229175514 > 20031211120627
    (EXP) INFO:  entry for BAPICRMKEY                        in DDNTT is newer than in DDNTT_CONV_UC: 20051229175654 > 20031211120714
    (EXP) INFO:  entry for BAPICRMKEY_T                      in DDNTT is newer than in DDNTT_CONV_UC: 20051229175835 > 20031211120803
    (EXP) INFO:  entry for BAPICRMMSG                        in DDNTT is newer than in DDNTT_CONV_UC: 20051229175654 > 20031211120714
    (EXP) INFO:  entry for BAPICRMMSG_T                      in DDNTT is newer than in DDNTT_CONV_UC: 20051229175835 > 20031211120803
    (EXP) INFO:  entry for BAPICRMOBJ                        in DDNTT is newer than in DDNTT_CONV_UC: 20051229175514 > 20031211120628
    (EXP) INFO:  entry for BAPICRMPAREX_T                    in DDNTT is newer than in DDNTT_CONV_UC: 20051229175452 > 20031211120305
    (EXP) INFO: limit reached, 5000 tables in DDNTT are newer than in DDNTT_CONV_UC
    (EXP) INFO: NameTab check finished. Result=2  #20100113131216
    (EXP) INFO: check for inactive NameTab entries: Ok.
    (RSCP) INFO: I18N_NAMETAB_TIMESTAMPS not in env: checks are ON (Note 738858)
    (DB) INFO: disconnected from DB
    D:\usr\sap\B35\SYS\exe\run/R3load.exe: job finished with 1 error(s)
    D:\usr\sap\B35\SYS\exe\run/R3load.exe: END OF LOG: 20100113131216
    ***SAPCLUST.log ****
    (NT)  Warn:  EDIDOC: normal NameTab from 20040211095029 younger than alternate NameTab from 20000621155733!
    (EXP) TABLE: "EDIDOC"
    (NT)  Warn:  PCDCLS: normal NameTab from 20040211095029 younger than alternate NameTab from 20000621155733!
    (EXP) TABLE: "PCDCLS"
    (NT)  Warn:  SFHOA: normal NameTab from 20040211095029 younger than alternate NameTab from 20000621155733!
    (EXP) TABLE: "SFHOA"
    (NT)  Warn:  SFHYT: normal NameTab from 20040211095029 younger than alternate NameTab from 20000621155733!
    (EXP) TABLE: "SFHYT"
    (NT)  Warn:  UMG_TEST_C: normal NameTab from 20040211095029 younger than alternate NameTab from 20031113150115!
    (EXP) TABLE: "UMG_TEST_C"
    myCluster (55.22.Exp): 712: error when retrieving alternate nametab description for physical table UMG_TEST_F.
    myCluster (55.22.Exp): 713: return code received from nametab is 32
    myCluster (55.22.Exp): 299: error when retrieving physical nametab for table UMG_TEST_F.
    (CNV) ERROR: data conversion failed.  rc = 2
    (RSCP) INFO: I18N_NAMETAB_TIMESTAMPS not in env: checks are ON (Note 738858)
    (DB) INFO: disconnected from DB
    D:\usr\sap\B35\SYS\exe\run/R3load.exe: job finished with 1 error(s)
    D:\usr\sap\B35\SYS\exe\run/R3load.exe: END OF LOG: 2010011312563
    Please suggest.
    Thanks & Regards
    Ganesh

    Is your DB unicode?  If so, did you select the unicode flag in sapinst?
    This [thread|System Copy Error while exporting ABAP; might offer some help.
    -Zach

  • What is the logical system name used for in R/3?

    We have a R/3 server. The production client has a logical system name. What is the logical system name used for?
    Tony Tam

    Hi Tony
    Following Links will help you in understanding the concept
    http://benstudycenter.blogspot.com/2008/02/logical-system.html
    http://help.sap.com/saphelp_sm32/helpdata/en/78/217dc151ce11d189570000e829fbbd/frameset.htm
    http://help.sap.com/saphelp_sm32/helpdata/en/78/217dc151ce11d189570000e829fbbd/frameset.htm
    thanks
    Bhudev

  • Scenario is HTTP to db. In HTTP client, when Sender is Business Component, Pi is getting data successfully but when Business system is used as sender Pi is not getting any message in sxi monitor. Please help

    Scenario is HTTP to db. In HTTP client, when Sender is Business Component, Pi is getting data successfully but when Business system is used as sender Pi is not getting any message in sxi monitor. Please help

    Hi Ankita,
    Try to trace at ICM level, Go to smicm transaction
    Set level to 3.
    Later send your request. Finally trace the request in:
    When you have seen the log, check if any exception is raised with your request or the request and share it here.
    Regards.

  • ABAP+JAVA system copy using 3rd party export/import tools

    Hi all,
    I am trying to do a homogenous system copy.  I am following the syscopy guide for SAP NW 7.0 SR3 ABAP+JAVA systems
    We are running AIX 5.L and Oracle.
    My question is this.  We are using an IBM XiV system for our disk storage, and we are able to restore from "snaps" which is their version of images.  Does anyone know if it is possible to restore or "import" the data in a system copy using an outside tool like this?  If so, do you have any information on how to?
    I know it is possible to restore the database from an offline backup using BRTools rather than r3load and jload, and I just wanted to see if I can restore from a snap as it would save a lot of time in the procedure.
    Any help or ideas would be much appreciated.
    Thanks!

    >My question is this.  We are using an IBM XiV system for our disk storage, and we are able to restore from "snaps" which is their version of images.  Does anyone know if it is possible to restore or "import" the data in a system copy using an outside tool like this?  If so, do you have any information on how to?
    That approach is not supported.
    The reason is: combined instances write the instance name and hostname in various places, on the filesystem in .properties files, in the JDBC configuration, depending on the java applications you run on top in various other places. What you're trying to do is effectively "renaming" an instance.
    Technically it's possible to do it and to get it run, yes, but the supported way is running sapinst and choose ABAP + Java system copy. This will prevent you from lots of (not really documented) manual work after the copy.
    Markus

  • Download of pdf to our local system by using classes in webdynpro abap

    hi,
    I createa an application ,in that i converted Smartform to Pdf.I want to download the generated pdf to our local system by using "cl_wd_runtime_services" because we cant directly use FM GUI_DOWNLOAD directly.So can any one please tell me the process.

    Hi ,
    see the below code..
    call function 'CONVERT_OTF'
          exporting
            format                = 'PDF'
          importing
            bin_filesize          = pdf_size
            bin_file              = LV_PDF
          tables
            otf                   = lt_otfdata[]
            lines                 = l_dummy
          exceptions
            err_max_linewidth     = 1
            err_format            = 2
            err_conv_not_possible = 3
            others                = 4.
        if sy-subrc <> 0.
          message id sy-msgid type sy-msgty number sy-msgno
          with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        endif.
    lv_string = filename
    cl_wd_runtime_services=>attach_file_to_response(
          i_filename  =  LV_STRING
          i_content   = lv_pdf
          i_mime_type = 'pdf/application'
          i_in_new_window = abap_false
          i_inplace       = abap_false ).
    this will open a popup same as when u download some file...
    Regards
    Yash

Maybe you are looking for

  • Auto update of time when changing time zones - PLEASE help.

    I travel for a living and I can't figure out how to get this 8310 to auto update the time when I fly from one time zone to another. Can anyone help me with this? Thank you so much in advance!

  • Condition type check in va01 transaction

    Hi friends, I have a requirment. in va01 transaction , at the line item level iam entering a  material number and order quantity and  when i press enter i get the corresponding values for that particular line item. now iam double clicking on that par

  • Rendering error whilst writing to file /filename etc./ An output module failed

    I'm trying to render my composition in the latest AE CC 2014.  I get the following error with all composition sizes and with different codecs:  Rendering error whilst writing to file /filename etc./ An output module failed. The file may be damaged or

  • XML output File Format change

    Hi experts, I am currenty getting below output in my XML file and it is wrapped in message type MT_Test. <?xml version="1.0" encoding="UTF-8"?> <ns0:MT_Test xmlns:ns0="http://test.com/xi/T1/Data"> <Tests> <schemaLocation>http://tempuri.org/TestSchema

  • SQL Developer in Oracle 11g

    Hi all, When trying to start SQL Developer shipped with Oracle 11g for Windows 32-bit, the following error raised: http://www.ahmedbaraka.com/temp/error2.JPG OS: Windows XP SP2 with 1GB RAM DB: Oracle Database 11g Enterprise Edition Release 11.1.0.6.