stefano,
@stefano@bsd.cafe avatar

This morning, a VPS hosting a small e-commerce site (powered by WooCommerce on Ubuntu 22.04) experienced another out-of-memory issue. A colleague (one of the developers) urgently called me, asking to upgrade the VPS due to excessive load.

I pointed out (again, as has often happened in recent weeks) that a VPS with 32GB of RAM (!!!) and 16 dedicated cores (!!!) should not run out of memory with just five simultaneous visits to a small e-commerce site. We host much larger and busier websites on much smaller VPSs. There's likely a WordPress module with a leak, or some interaction between modules causing this issue.

The response: Okay, but just add more RAM and power to solve it.

The illusion of "infinite resources" in the Cloud has led to poor development habits. Sometimes I wonder how much energy and resources we waste (and pollution we generate) due to a lack of basic optimization.

#Tech #Development #CloudComputing #Optimization #WebHosting #WooCommerce #Ubuntu #WordPress #Sustainability #TechRant

kkarhan,

@stefano nodds in agreement

I literally had a falling-out about disagreeing to not shovel mission-critical systems to #aws because I saw neither benefit nor value giving money and data to what is essentially a competitior and getting a worse product for more money than the existing tech stack.

And it's not lile their business model or workflows needed a huge #Cloud or #DevOps...

That's all I can say legally...

We need #FrugalComputing more and I work towards it with @OS1337

pies,
@pies@qoto.org avatar

@stefano In a business it might make sense to raise the resources until the problem is fixed. It might also be cheaper to run a larger server instead of getting devs to optimize it/fix it.

SenseException,
@SenseException@phpc.social avatar

@stefano Is it still faster and cheaper accomplished than letting a developer find out one or multiple reasons for these problems?

I can tell that devs weren't allowed to put time into research and fixes because of this reason.

jrefior,
@jrefior@hachyderm.io avatar

@stefano
In my work experience, the amount wasted is massive.

the_Effekt,

@stefano

I saw this at an agency as a front end developer, building Coldfusion sites on MURA templates.

It wasn't about optimizing functionality. It was about packing in code (or extensions/plugins) until something worked. I was even admonished for stripping out the previous failures.

18+ ado,

@stefano Out of curiosity, where would you start to solve this? `vmstat?

stefano,
@stefano@bsd.cafe avatar

@ado I start looking at the logs and a couple of ps. When I see the php processes that start eating ram like crazy, I understand what's happening. Then I try to limit the number of concurrent php processes but this usually kills the performance, for concurrent visits.
The only way to solve is...fixing the code 😉

linus,
@linus@telegrafverket.cc avatar

@stefano cloud images often come without any swap configured, sometimes it’s as easy as just configuring swap period to at least avoid OOM murder. with Ubuntu you also have the luxury of making it ZFS.

stefano,
@stefano@bsd.cafe avatar

@linus that's a VM I have personally installed in a Proxmox VM - swap is enabled, but gets filled up as well

linus,
@linus@telegrafverket.cc avatar

@stefano if swap isn’t compressed and what’s being put there is text for example it could make a big difference, not just for storage but paging throughput as well. still, obviously there’s no way to fix bad code with platform changes.

stefano,
@stefano@bsd.cafe avatar

@linus sure, that would help. But I can't tolerate that a single visit to a simple e-commerce spins up many php processes that occupy more than 6 GB of ram, per concurrent visits. There's something absolutely wrong there.

wtfismyip,
@wtfismyip@gnu.gl avatar

@stefano @linus On https://wtfismyip.com, we're serving around 1000rps. Memory footprint is under 8GB; uses about 3 modern AMD cores. Seems many webapps using PHP aren't well thought out from a performance perspective.

Nerdfest,
@Nerdfest@mastodon.online avatar

deleted_by_author

  • Loading...
  • stefano,
    @stefano@bsd.cafe avatar

    @Nerdfest @ado "Hardware is silent and programmers are sure that optimizing is a total waste of time" 🙂

  • All
  • Subscribed
  • Moderated
  • Favorites
  • tech
  • DreamBathrooms
  • ngwrru68w68
  • modclub
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • mdbf
  • GTA5RPClips
  • JUstTest
  • ethstaker
  • normalnudes
  • tester
  • osvaldo12
  • everett
  • cubers
  • tacticalgear
  • anitta
  • Leos
  • provamag3
  • cisconetworking
  • megavids
  • lostlight
  • All magazines