Hello,
I have a PHP Client and WebSocket backend, my current setup is in Europe but my customer base is 50% EU and 50% US.
So won’t people connecting from America have slow access to my site right?
How can I make this better?
I did some research and most suggested a Serverless PHP and AWS RDS setup since they run on multiple regions but the costs are really high for my startup like 3000 dollars per month.
If I buy a server in the US and deploy my client there too while using load balancing on Cloudflare will the results be the same since my database is in Europe?
Honestly, I have been confused about this for days how do others deal with it?
I don’t trust those website ping test results but my Cloudflare report from the USA shows these times;
Time To First Byte 0.26 seconds
First Contentful Paint 1.08 seconds
Largest Contentful Paint 2.57 seconds
Time to Interactive 2.60 seconds
Total Blocking Time 1 millisecond
Speed Index 1.83 seconds
Cumulative Layout Shift 0.01
Are these numbers good if they are good maybe it’s related to Cloudflare servers I don’t have much experience on this.
@Hale
That wasn’t a ping, I meant actual connections.
If Cloudflare is in front, I wouldn’t worry too much about it as they handle the final connections that are closest to the user removing your concerns.
I faced this exact issue when scaling my previous SaaS projects and here’s what worked:
Start with Cloudflare – it’s free and boosts performance globally by using their CDN. Plus you get DDoS protection which is a bonus.
If you’re using Cloudflare, the next step is to use edge caching. Cache as much static content as possible at the edge. This will help your initial page load times.
For your database – yes keeping it just in the EU will create latency for US users. Instead of going fully multi-region (which is expensive like you found), you could:
Set up read replicas in the US (cheaper than full multi-region).
Use Redis or Memcached caching in the US for frequently accessed data.
Optimize your queries and only hit the EU database when necessary.
Don’t rush into serverless and multi-region setups yet. It’s likely too much for your current stage and will use up your resources quickly. Start with basics like CDN, caching, and read replicas and scale up only when needed.
If you still have issues after trying these, feel free to message me – I can check your setup and suggest more optimizations
Having a good setup is much more important than just server location. It’s good to be near customers, but if I had one thing to optimize it so wouldn’t be location.
Shan said:
Having a good setup is much more important than just server location. It’s good to be near customers, but if I had one thing to optimize it so wouldn’t be location.
Yes, that’s what I’m asking what should I focus on
@Hale
There’s general advice for this (optimizing assets, caching strategies, and server tuning) but first, find the bottlenecks; that’s when you can build a solid optimization plan based on real evidence. Otherwise, you might waste time on things that won’t yield good results.
Use tools like Datadog, Web Page Test or Pingdom, and New Relic to check your front and back-end code for performance issues.
Zuri said:
Can your pages be cached If so using a CDN with caching could help
My pages are fully dynamic I don’t think caching will fix my issue, and yes my client is cached and my PHP client is also using opcache jit and I’m using Cloudflare with all features so I have CDN.