<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Ok so I made one more semi useful script for a resource control hack, again I make no claims of actual usability or benefit, as of posting this it seems to be working well on my #friendica instance;]]></title><description><![CDATA[<p>Ok so I made one more semi useful script for a resource control hack, again I make no claims of actual usability or benefit, as of posting this it seems to be working well on my <a href="https://social.2ndshot.photos/search?tag=friendica" rel="tag">#<span>friendica</span></a> instance;</p><p><a href="https://social.2ndshot.photos/search?tag=%21%2Fbin%2Fbash" rel="tag">#<span>!/bin/bash</span></a></p><p># These are the Bouncer's Rules<br />MAX_KIDS=3        # Only 3 people in the kitchen at once<br />MAX_HEAT=2        # Only 2% energy allowed<br />CHECK_TIME=5      # Wait 5 seconds before checking again</p><p>while true<br />do<br />  # 1. Count how many 'lsphp' workers are busy with your site<br />  CURRENT_KIDS=$(pgrep -f "lsphp.*YOUR_INSTANCE_ROOT" | wc -l)</p><p>  # 2. If there are more than 3...<br />  if [ "$CURRENT_KIDS" -gt "$MAX_KIDS" ]; then<br />    echo "Bouncer: Too many kids! Making the extras wait in the hallway."</p><p>    # This finds the newest workers and tells them to 'STOP' (Pause)<br />    # They stay in line, but they don't use any CPU while paused.<br />    pgrep -f "lsphp.*YOUR_INSTANCE_ROOT" | tail -n +$((MAX_KIDS+1)) | xargs kill -STOP</p><p>    # Wait for things to cool down<br />    sleep $CHECK_TIME</p><p>    # Tell them they can 'CONT' (Continue) one by one<br />    pgrep -f "lsphp.*YOUR_INSTANCE_ROOT" | xargs kill -CONT<br />  fi</p><p>  # Take a small breath so the Bouncer doesn't get tired<br />  sleep 1<br />done</p><p><br /><b>README</b><br /><img src="https://citiverse.it/assets/plugins/nodebb-plugin-emoji/emoji/android/1f6aa.png?v=4307f250d0d" class="not-responsive emoji emoji-android emoji--door" style="height:23px;width:auto;vertical-align:middle" title="🚪" alt="🚪" /> The LSPHP Bouncer<br />Resource Throttle &amp; Process Queue for Shared Hosting<br />The LSPHP Bouncer is a lightweight Bash watchdog designed for users on LiteSpeed-based hosting. It prevents your account from hitting "Resource Limit Reached" errors (508 errors) by pausing excess PHP processes (lsphp) instead of letting them crash the site or trigger a provider-level kill.</p><p><img src="https://citiverse.it/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=4307f250d0d" class="not-responsive emoji emoji-android emoji--warning" style="height:23px;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ Maintenance Notice<br />This project is provided "as-is" for educational and personal use.</p><p>It will not be maintained or updated.</p><p>No support or bug fixes will be provided.</p><p>Use at your own risk..</p><p>🧐 How It Works<br />LiteSpeed servers often spawn many lsphp workers to handle incoming traffic. If too many start at once, your host might lock your account for exceeding CPU or process limits.</p><p>The Headcount: Every second, the Bouncer counts how many PHP workers are active for your specific site.</p><p>The Velvet Rope: If the count exceeds your MAX_KIDS limit, the Bouncer sends a SIGSTOP signal to the extra processes. This pauses them—they stay in the queue but stop consuming CPU cycles.</p><p>The Entry: After a short cooldown (CHECK_TIME), the Bouncer sends a SIGCONT signal, letting those processes finish their work one by one.</p><p><img src="https://citiverse.it/assets/plugins/nodebb-plugin-emoji/emoji/android/1f6e0.png?v=4307f250d0d" class="not-responsive emoji emoji-android emoji--hammer_and_wrench" style="height:23px;width:auto;vertical-align:middle" title="🛠" alt="🛠" /> Configuration<br />Open the script and adjust these "House Rules" to match your hosting plan:</p><p>MAX_KIDS: The maximum number of PHP processes you are allowed (e.g., 3).</p><p>CHECK_TIME: How many seconds to pause the "extras" before letting them work again.</p><p>Process Filter: The script looks for "lsphp.*your.domain". Ensure the string matches what shows up in your process monitor (usually top or htop).</p><p><img src="https://citiverse.it/assets/plugins/nodebb-plugin-emoji/emoji/android/1f680.png?v=4307f250d0d" class="not-responsive emoji emoji-android emoji--rocket" style="height:23px;width:auto;vertical-align:middle" title="🚀" alt="🚀" /> Setup &amp; Execution<br />1. Make it Executable<br />Bash<br />chmod +x bouncer.sh<br />2. Run the Bouncer<br />To keep the Bouncer running even after you log out of SSH:</p><p>Bash<br />nohup ./bouncer.sh &gt; /dev/null 2&gt;&amp;1 &amp;<br /><img src="https://citiverse.it/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4c8.png?v=4307f250d0d" class="not-responsive emoji emoji-android emoji--chart_with_upwards_trend" style="height:23px;width:auto;vertical-align:middle" title="📈" alt="📈" /> Why use this?<br />Avoids 508 Errors: Instead of the server showing a "Limit Reached" page, the site just feels a tiny bit slower while the Bouncer staggers the load.</p><p>CPU Friendly: Paused processes (kill -STOP) consume zero CPU, helping you stay under the "Energy" or "Heat" limits of your host.</p><p>Specific Targeting: Using pgrep -f, it only targets your specific site's workers, leaving other processes alone.</p><p><img src="https://citiverse.it/assets/plugins/nodebb-plugin-emoji/emoji/android/2696.png?v=4307f250d0d" class="not-responsive emoji emoji-android emoji--scales" style="height:23px;width:auto;vertical-align:middle" title="⚖" alt="⚖" />️ License (MIT)<br />Copyright (c) 2026 pasjrwoctx<img src="https://citiverse.it/assets/plugins/nodebb-plugin-emoji/emoji/android/1f47d.png?v=4307f250d0d" class="not-responsive emoji emoji-android emoji--alien" style="height:23px;width:auto;vertical-align:middle" title="👽" alt="👽" /> (Philip A. Swiderski Jr.)</p><p><b>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</b></p><p><b>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</b></p><p><b>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</b></p><p><span><a href="/user/">@<span>helpers</span></a></span> <span><a href="/user/">@<span>developers</span></a></span> <span><a href="/user/">@<span>admins</span></a></span></p><p>You can encourage my continued useless ideas, and by doing so your helping to feed, house and clothe a <a href="https://social.2ndshot.photos/search?tag=disabled" rel="tag">#<span>disabled</span></a> man living in <a href="https://social.2ndshot.photos/search?tag=poverty" rel="tag">#<span>poverty</span></a>, $5-10-15 It All Helps, via <a href="https://social.2ndshot.photos/search?tag=cashapp" rel="tag">#<span>cashapp</span></a> at $woctxphotog or via <a href="https://social.2ndshot.photos/search?tag=paypal" rel="tag">#<span>paypal</span></a> at <a href="https://www.paypal.com/donate?campaign_id=5BN5MB5BVQL22" rel="noopener noreferrer">paypal.com/donate?campaign_id=…</a></p>]]></description><link>https://citiverse.it/topic/6cfab5d6-ee8b-4b38-af86-58e9b78805cb/ok-so-i-made-one-more-semi-useful-script-for-a-resource-control-hack-again-i-make-no-claims-of-actual-usability-or-benefit-as-of-posting-this-it-seems-to-be-working-well-on-my-friendica-instance</link><generator>RSS for Node</generator><lastBuildDate>Thu, 14 May 2026 20:24:57 GMT</lastBuildDate><atom:link href="https://citiverse.it/topic/6cfab5d6-ee8b-4b38-af86-58e9b78805cb.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 30 Apr 2026 19:44:43 GMT</pubDate><ttl>60</ttl></channel></rss>