1

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.

kamal0808
  • 515
  • 1
  • 8
  • 21
  • You're not going to get 100K users overnight. You'll be able to get a much better idea of the bottlenecks once you get real people on the site. IMHO, wait to scale until you actually need to scale. – Sam Dufel Oct 19 '13 at 22:11
  • Destruction test using something like [Gatling](http://gatling-tool.org/) – Mark Baker Oct 19 '13 at 22:13
  • @Sam Dufel - Just trying to plan my way out. I don't want the website servers to crash and get stuck over it, losing users every second. Plus, it is targeted for a specific group of people, one of its kind. It mayy need scalability options earlier than usual. – kamal0808 Oct 19 '13 at 22:17
  • What sort of page response times are you getting on your development machine? Don't use a shared host for this, use VPS or cloud. – halfer Oct 19 '13 at 22:49

2 Answers2

4

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

Community
  • 1
  • 1
Wayne Whitty
  • 19,513
  • 7
  • 44
  • 66
  • Can I go with the shared servers without Memcached on Apache? I would actually be going to pay for a 3 months trial atleast. – kamal0808 Oct 19 '13 at 22:22
0

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.

yknivag
  • 85
  • 1
  • 8