SShortSingh.
Back to feed

PHP App Cuts Database CPU from 100% to 68% by Offloading 1M Updates to RabbitMQ and Go

0
·1 views

A legacy PHP marketing dashboard was crashing daily when business users triggered bulk operations affecting up to one million customer records, causing database CPU to spike to 100% and HTTP requests to time out. The synchronous PHP flow fetched and processed all rows within a single request, leading to partial updates and duplicate actions on retries. Engineers resolved the issue by decoupling the process: PHP now publishes user IDs to a RabbitMQ queue and immediately returns a 202 response, while a dedicated Go worker consumes messages in batches and applies atomic database updates. This architectural change brought database CPU usage down from 100% to 68% and eliminated the daily crashes. The team also outlined future improvements, including an adaptive batch-sizing mechanism that automatically adjusts processing speed based on real-time database load.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingHacker News ·

Kontigo, a YC S24 startup, is hiring a Founding Engineer

Kontigo, a startup that participated in Y Combinator's Summer 2024 batch, has posted an open position for a Founding Engineer. The job listing was shared on Hacker News, Y Combinator's associated tech community platform. The role is listed directly on Y Combinator's company directory under Kontigo's profile. No further details about the company's focus or compensation were provided in the listing.

0
ProgrammingDEV Community ·

How to Merge Data from Multiple Excel Files Using VBA, Power Query, and AI

Data professionals frequently struggle to consolidate specific sheets from large numbers of Excel files into a single unified table. The task grows more complex when sheet names vary across files and data structures are inconsistent, with mismatched headers, column orders, and data types. Manual copy-paste methods are error-prone and unscalable, while VBA macros offer automation but require coding knowledge. Power Query provides a more accessible middle ground for structured consolidation workflows. Modern AI-assisted tools are also emerging as potential solutions to handle inconsistencies and reduce manual intervention in data merging tasks.

0
ProgrammingDEV Community ·

How to Build a WhatsApp Landing Page Clients Can Edit Without Breaking It

A developer tutorial on DEV Community outlines how freelancers and studios can create maintainable WhatsApp landing page templates for clients. The guide recommends defining the page's purpose and editable elements — such as headline, services, colors, and phone number — before writing any code. It emphasizes centralizing the WhatsApp number and pre-filled message in a single, clearly commented constant to minimize handover errors. Placeholder text like [Business Name] and [Service Area] should be used throughout demos instead of fabricated testimonials or metrics. The author also provides a pre-launch checklist and links to a public CodePen demo, with paid licensing options starting at USD 20 per project.

0
ProgrammingDEV Community ·

Vaniq-Edge: 34MB Open-Weight TTS Engine Achieves 2.94% Word Error Rate

A developer has released Vaniq-Edge, a lightweight, end-to-end text-to-speech engine with approximately 8.5 million parameters and a file size of just 34.3 MB. The model converts text directly to 24kHz mono audio without relying on external vocoders or secondary models. It achieves a Word Error Rate of 2.94% and a predicted audio quality score of 4.35 out of 5, while running faster than real-time on both GPU and single-core CPU. The model is available as open weights on Hugging Face and can be tested locally using Python. Key limitations include support for English only, a single fixed voice, and occasional high-frequency audio artifacts on certain consonants.

PHP App Cuts Database CPU from 100% to 68% by Offloading 1M Updates to RabbitMQ and Go · ShortSingh