From PHP to NODE and back to PHP

I developed an auction website with PHP using and action scheduler. All of this worked well, but as soon as you get to more than about 250 users on the site it started to cause a few problems because of all the requests. If you on shared hosting or a host that limits your max children and max sql connections.

So then everybody said go NODE… go NODE… WebSocket’s is king… for this… So I went down this rabbit hole… it was a big learning curve and to be honest PHP server connect and in general PHP is way more forgiving than NODE… but never the less the site was converted to Node with websockets and working like a charm….

I loaded this to Digital Ocean and great… its working!.

BUT 2 things that became a BIG issue…

  1. Cost of running on cloud. You cannot run a site like this on anything less than 4GB of RAM. So out of the gate its was costing 20 – 24 USD… then if you want to make sure you have a backup. Add another 4 – 5 USD ----- SO now its 30USD for hosting a month…

  2. SPEED…. Because I selected London as my server… the pings are from 140 – 180ms…
    As they do not have a sever here is South Africa… and that causes a big issues in speed if you running a auction site…. Maybe if DO had a sever here and we were getting 30 – 50ms then we could still bite the bullet for 20 - 24 USD without backups per client….

So… the next step was to use AMAZON in Cape Town…
When you see AWS costs!!!. then you want to run even more…. For the same things as DO … you are looking at 35 – 40 USD … CRAZY!!

So 15 clients x 35 USD = 525 USD a month!!!

AWS should give me better speeds than DO… but at the cost…… my clients wont be happy….
As you would need to increase the cost to client with 35% overnight……

Don’t get me wrong Node is great… it works so so smoothly with WebSocket’s for the Realtime data, but in reality if you don’t have a open big budget… then you might want to reconsider.

SO… BACK TO PHP!!! Good old faithful. @JonL (might unfriend me now)
The only reason is because of the factors of the above……

The cost of the dedicated server(php) is nothing compared to having separate sites on AWS! We opted for a dedicated server and added 64GB of RAM to it… overkill… as this sorts out our “action scheduler” problem. Setting the PHP setting max children and max connections to optimum. Now the cost works out to max 10 – 12 USD cost to client… and we have a “managed dedicated” server… backups, ssl auto install, security and doss protection (where you on your own with DO)

Dedicated (managed) server cost a year 1200 USD
Hosting multiple sites of other clients, not just auction sites covering the cost is a no brainer…

The speed is back to 30 – 50ms … I know it does not sound that much of a difference. but trust me with the auction site… it’s a HUDGE difference…

So in a nutt shell
Node is great with WebSocket’s providing real time data! …
But take into consideration your location, the cost…and speed… not just the hosting. But all the add-ons. AWS… backups… routing… SSL… S3… load balancers (if needed)……

I dont have any regret learning Node…as i have gained experience… as i have a fully working auction site done with node…smooth as butter. Just a pity the above factors wont allow me to use this…

Community Page
Last updated: