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.
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!
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.
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!
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.
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.