<p>Friends, friends of friends… 2 dates next week to hear and meet me:<br>10/02: I am performing *être script* (french version) at La Générale (Paris) 7.30PM <a href="https://www.mig.fyi/" rel="nofollow"><span class="invisible">https://</span>www.mig.fyi/</a> also broadcasted on <a href="https://p-node.org/" rel="nofollow"><span class="invisible">https://</span>p-node.org/</a><br>————<br>11/02: I am live coding ambient stuff at Lithium, a café (and an online radio) 6 rue Saint Blaise, Paris. Starting at 5PM. <a href="https://lithium.fm/" rel="nofollow"><span class="invisible">https://</span>lithium.fm/</a><br>————<br>For both events, I will have zines and fediverse stickers to sell (cheap).<br>————<br>Details, RSS: <a href="https://news.raphaelbastide.com/" rel="nofollow"><span class="invisible">https://</span>news.raphaelbastide.com/</a><br><a href="/tags/livecoding/" rel="tag">#livecoding</a> <a href="/tags/performance/" rel="tag">#performance</a> <a href="/tags/paris/" rel="tag">#paris</a> <a href="/tags/radio/" rel="tag">#radio</a> <a href="/tags/ambient/" rel="tag">#ambient</a></p>
performance
<p>Tuning PieFed for scale</p><p>Out of the box PieFed has some pretty conservative settings, intended for small (less than 10 users) to medium (less than 200 active users) instances running on small servers where memory is constrained.</p><p>Now that piefed.social is becoming busier I’ve needed to tweak a few settings:</p><p>Gunicorn</p><p>Gunicorn is the service that runs the web app within itself and accepts connections from nginx. When you get a lot of traffic sometimes gunicorn can run out of capacity to serve all the incoming requests.</p><p>Each request uses one thread so you need to have as many threads as your CPU cores can handle but not so many that they get flooded and start to context switch too much. The variables in gunicorn.conf.py called ‘processes’ and ‘threads’ determine this. The total number of threads will be processes * threads so keep ‘processes’ low and increase ‘threads’ as needed. </p><p>There will be a point where adding more threads makes things worse rather than better.</p><p>Celery</p><p>Celery is the service used to execute background tasks such as processing federation activity, sending emails and so on. If you can see the amount of RAM used by redis (used to queue up things for celery to work on) is growing larger and larger then you probably don’t have enough celery worker processes.</p><p>Bare metal celery: in /etc/default/celeryd, tweak the autoscale parameter in CELERY_OPTS. The numbers are the maximum and minimum amount of processes to run. Max should probably be no more than 2x your CPU cores.</p><p>Docker-based celery: in entrypoint_celery.sh, look for the autoscale parameter. You’ll need to rebuild the docker image after changing this.</p><p>Database connections</p><p>A default docker-based instance will be using postgresql with no tuning at all, which will not scale well. In .env.docker you can set some environment variables to give Postgresql more to work with. e.g.</p><p>POSTGRES_SHARED_BUFFERS=2GBPOSTGRES_EFFECTIVE_CACHE_SIZE=3GBPOSTGRES_WORK_MEM=8MB</p><p>and/or increase shm_size in compose.yaml to be 25% of RAM. See <a href="https://pgtune.leopard.in.ua/" rel="nofollow">PGTune</a> for details.</p><p>Bare-metal servers can tune their postgresql server by creating a file in /etc/postgresql/14/main/conf.d/whatever.conf.</p><p>Ensure your postgresql server can handle 300 connections – it’s not just each gunicorn thread that will be connecting, there will be celery processes too.</p><p>Here is the piefed.conf I’m using on piefed.social with ~1000 MAU, 8 CPU cores and 16 GB of RAM:</p><p>synchronous_commit = off<br>wal_writer_delay = 2000ms<br><br>max_connections = 300<br>shared_buffers = 6GB<br>effective_cache_size = 9GB<br>maintenance_work_mem = 1GB<br>checkpoint_completion_target = 0.9<br>wal_buffers = 16MB<br>default_statistics_target = 100<br>random_page_cost = 1.1<br>effective_io_concurrency = 200<br>work_mem = 10MB<br>huge_pages = off<br>min_wal_size = 1GB<br>max_wal_size = 3GB<br>wal_compression = on<br>max_worker_processes = 8<br>max_parallel_workers_per_gather = 3<br>max_parallel_workers = 8<br>max_parallel_maintenance_workers = 4<br></p><p>max_worker_processes should be the number of CPU cores you have. </p><p>The main web app container / service has two environment variables that control the database connection pool and the defaults (used when no value is in the .env) are quite small. Try:</p><p>DB_MAX_OVERFLOW = 70DB_POOL_SIZE = 30</p><p>Don’t panic</p><p>This is an evolving situation and there is no one size fits all configuration. Drop in to <a href="https://chat.piefed.social" rel="nofollow">chat.piefed.social</a> to share what you find or ask for help.</p><p><a href="/tags/performance/" rel="tag">#performance</a> <a href="/tags/piefed/" rel="tag">#piefed</a></p>
Edited 271d ago
<p>For those looking for a break from default reality I highly recommend this Longmont Potion Castle ‘prank call’. It’s NOT a typical prank call, it’s more like prank-call psychedelic performance art. Length: 3.43 minutes,</p><p>How cool is that?</p><p><a href="https://www.youtube.com/watch?v=AkvjzPDbw4Q" rel="nofollow" class="ellipsis" title="www.youtube.com/watch?v=AkvjzPDbw4Q"><span class="invisible">https://</span><span class="ellipsis">www.youtube.com/watch?v=AkvjzP</span><span class="invisible">Dbw4Q</span></a></p><p>(I make no $$$ from this reference, this is not an affiliate link. I’m just a fan wanting to share the joy!)</p><p><a href="/tags/art/" rel="tag">#art</a> <a href="/tags/entertainment/" rel="tag">#entertainment</a> <a href="/tags/pranks/" rel="tag">#pranks</a> <a href="/tags/prankcalls/" rel="tag">#prankcalls</a> <a href="/tags/longmontpotioncastle/" rel="tag">#longmontpotioncastle</a> <a href="/tags/performance/" rel="tag">#performance</a></p>
Edited 82d ago
<p>Am 3.6. wird "Sharper Than A Needle" erneut in der Therese-Giehse-Halle der <a href="/tags/münchnerkammerspiele/" rel="tag">#MünchnerKammerspiele</a> aufgeführt.</p><p><a href="https://www.muenchner-kammerspiele.de/de/programm/37763-sharper-than-a-needle" rel="nofollow" class="ellipsis" title="www.muenchner-kammerspiele.de/de/programm/37763-sharper-than-a-needle"><span class="invisible">https://</span><span class="ellipsis">www.muenchner-kammerspiele.de/</span><span class="invisible">de/programm/37763-sharper-than-a-needle</span></a></p><p><a href="/tags/münchen/" rel="tag">#München</a> <a href="/tags/performance/" rel="tag">#Performance</a></p>