Question

I have developed a Social Networking website based on WAMP(Windows, Apache, MySQL, PHP) server. I put it up on a Free Host (the hosting serves it in LAMP), and it works fine.

Now, I researched a little and found out that PHP applications are difficult to scale, and take a lot of parallel algorithms. I would like to test how many users does the webhost support for my website, and how much does my localhost.

It's a social network like any other, involving:

  • Posting data on main page(with images).
  • Chat between users (with polling every 3 seconds, consider as one in facebook).
  • A question-answer forum(just as this one, or yahoo answers - including upvotes,downvotes, points etc)
  • Two HTML5 server sent event loops running infinitely.
  • Many AJAX requests for retrieving data from MySQL database.

As for now, I haven't applied any Cache options, which I plan for later. Also, the chat application has to be switched from Polling to Websockets(HTML5).

My estimated user database goes to be a lot more than 100,000 users. That may need some serious scalability.

I need to know what kind of server may I need for the same. Should it be a dedicated server, should it be 2 of 'em or even more?

I tried this ab.exe located in bin folder of Apache, but it tests the location we provide manually. A social network needs login information to access all the data, which unfortunately limits the functionality of ab.exe only to availability of the "Welcome" page, and nothing towards the AJAX and HTML5 features which I mentioned above.

So, how exactly should I test the scalibilty of website for a hardware same as my laptop(Windows, Intel i5, 4gb Ram, 2.0 GHz), and what about scalability on Shared servers available out there, or even the dedicated ones.

Was it helpful?

Solution

Simply put: You are counting your chickens before they hatch. If you become overwhelmed by a bunch of new users, then that is what we tend to call a "good problem". If you're worried about scalability along the way, then you should look into:

  1. Caching with Memcached or Redis.
  2. Load balancing.
  3. Switching from Apache to Nginx.
  4. Providing a proper CDN.
  5. Since you're using PHP, you should install an opcache.

There are a lot of different ways to squeeze out results. Until you need them, I'd suggest sticking by best practices (normalization, etc).

OTHER TIPS

If you are worried about the capacity of your hosting company to cope with your application then the first thing to do is to contact them and discuss what capacity they have available and how scalable their environment is.

Unless you are hosting yourself, then you have virtually no control over the situation.

But if you believe the number of users is going to grow very quickly then it would be wise to enter a dialogue very early with your provider.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top