social.coop is one of the many independent Mastodon servers you can use to participate in the fediverse.
A Fediverse instance for people interested in cooperative and collective projects. If you are interested in joining our community, please apply at https://join.social.coop/registration-form.html.

Administered by:

Server stats:

479
active users

#webperformance

2 posts2 participants0 posts today

Tuning PostgreSQL for PieFed

Every instance will be different but generally speaking the default settings that PostgreSQL has will be Ok to start with but once the instance has been running for a few months the amount of data being stored will mean things start to bog down and some tuning is needed.

https://pgtune.leopard.in.ua will give you a good starting point.

What we use on piefed.social, with 4 CPU cores and 8 GB of RAM is:

synchronous_commit = offwal_writer_delay = 2000msmax_connections = 200shared_buffers = 1GBeffective_cache_size = 4GBmaintenance_work_mem = 1GBcheckpoint_completion_target = 0.9wal_buffers = 16MBdefault_statistics_target = 100random_page_cost = 1.1effective_io_concurrency = 200work_mem = 10MBhuge_pages = offmin_wal_size = 1GBmax_wal_size = 3GBmax_worker_processes = 4max_parallel_workers_per_gather = 2max_parallel_workers = 4max_parallel_maintenance_workers = 2

That’s pretty much what pgtune provided me except work_mem is a bit bigger.

Save this text in a file at /etc/postgresql/14/main/conf.d/piefed.conf.

The “14” part of that path will vary depending on your postgresql version.

pgtune.leopard.in.uaPGTune - calculate configuration for PostgreSQL based on the maximum performance for a given hardware configurationPgTune - Tuning PostgreSQL config by your hardware

Instead of writing a long blog post, I'll just post this here:

Responsive HTML image preloads don't work very well. I'm not sure what is causing it but it seems like the viewport size is unknown until the page starts rendering, so the largest image size from the imagesrcset is preloaded instead of the appropriate size for the given viewport.

But it is no biggie, as lazy loading images below the fold is more effective than preloading large static images.

Part 1 of a series about the power of the modern Web Platform.

Instead of focusing on one particular technology, each post is a mini case study based on a client project which I built in 2018 then refreshed in 2024. This one is about image performance, covering the Picture element, lazy loading, and speculative preloading with Intersection Observers.

🔗 chrisruppel.com/blog/modernizi

Chris RuppelModernizing with the Web Platform: Image performance
More from Chris Ruppel

Just published the results of my annual dive into the HTTP Archive. Some interesting findings:

😱 Median page has grown 8%
😱 90p page has grown 24%
😱 90p mobile page is almost 10MB
😱 Main culprits: JS & video

Dig in and learn what your page size targets should be and how to hit them.

speedcurve.com/blog/page-bloat

SpeedCurveSpeedCurve | Page bloat update: How does ever-increasing page size affect your business and your users?The median web page has grown 8% in one year. How does this affect your Core Web Vitals, your search rank, your business and your users?