I cannot run 3,000 clients per second to a basic Laravel app. I've tried both Caddy & NGINX, both fall over, which makes me think that it's something related to PHP FPM.

Or I'm missing something super obvious.

Hoping someone on here can give me some ideas 🙏
Server Spec: 16 cores & 32 GB RAM
PHP FPM Memory Limit: 9 MB
pm = static
pm.max_children = 2000 (also tried 500 & 2000)
pm.max_requests = 10000 (also tried 0)
I'm running the request to a route that returns 'woo', nothing else. The rest is default Laravel.

Web middleware disabled
2 non-default packages in composer (GeoIP2, jenssegers/agent and sentry/sentry-laravel)

artisan optimize run
opcache is on
debug is off
Not using AWS, using other provider
Bandwidth is unlimited & not throttled
All 16 cores shoot up to 100% when load testing

I'm really not a server guy, I live in the world of serverless (except when trying to scale our custom domains solution), so I may have missed something
Update: We're nearly there!! We couldn't even get past 2 seconds before. Now we're going a full minute!

I made a bunch of changes listed here: tweaked.io/guide/kernel/
Now I've learned a few tricks, I'm going to move to some smaller servers and balance them. The only reason I got hooked on this is because I couldn't believe a 16 core system was performing the same as lower end.
It's over. We're done.

Thanks so much to @raul_predescu, @stayallive and everyone else who replied. I learned a lot today.

End result? $160/month for 8,000 req/s 🥳
That's 21 billion requests a month

Most people will never need this.
I'll write about all of this next week.

• • •

Missing some Tweet in this thread? You can try to force a refresh

Keep Current with Jack Ellis

Jack Ellis Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!


Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @JackEllis

15 Oct
Low cost, high volume can be a very dangerous game.

For $10,000 MRR you'll need either:
- 2000 customers at $5/month
- 625 customers at $16/month

The difference between supporting 2000 customers and 625 customers is substantial, and you'll likely want to hire support staff.
Why am I writing about business margin again? Because it's been in my head for a while. And @mijustin resurfaced it a short while ago with his posts.

Developers often sell themselves short. But you need margin if you're going to operate your business in the best possible way.
Competing on price is what unambitious people do.

There are so many other ways you could, and should, compete in the market. Use your margin to introduce functionality that a cheap competitor can't. Build a better product. Find ways to provide more value!
Read 5 tweets
21 Sep
A few months ago, Justin Jackson was tweeting about margin in business non-stop. He persistently spoke about how important margin is in business.

Well he’s right. Your underpriced SaaS is going to shoot you in the ass.

Thread 👇
Margin allows you to absorb unexpected blows. You need margin to build an emergency fund. Some people live without emergency funds, and if their boiler breaks, they have to either go without or go into debt to fix it. It's a challenging way to live.
For businesses, lack of a margin will mean that you don't have the space to breathe. Your growth will be hindered if you don't have anything to re-invest into the business. Or you might have have unexpected costs, run out of cash flow and go out of business.
Read 17 tweets
24 May
7 years ago, I quit my job to pursue my first startup. I was living at home, my bills were less than £500 per month and I was confident I would build, launch and have 1,000 customers within 6 months. Easy, right?
I spent the first 3 months fighting with myself on the “right way” to code my application, spending hours in IRC talking about “clean code” and “spec tests”. After 3 months, I had some of the basics done... and lots of spec tests.
When I reached the end of 6 months, I failed to launch, and I ended up falling into freelancing.

Over the next few years, I would see another company launch what I had dreamed of, and I slowly drifted away from the idea that was Raw Gains.
Read 12 tweets

Did Thread Reader help you today?

Support us! We are indie developers!

This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!