Hosting Web site on cloud service [closed] - php

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Right now I am planning to build a news publication website that should be automatically scalable when traffic is increasing. I have good experience in developing web applications using ASP.NET and PHP. To move forward on selection of specific technology here are some questions for which I need some clarifications.
My primary intention is to reduce the hosting charges. If we choose LAMP this will cost lower than ASP.NET on Windows. As my intention is to host web application on cloud service, will this make any difference? Means, for dedicated servers we need to pay extra cost for Windows O/S if you compare it with Linux. If we go for cloud servers, will they charge anything for O/S for each instance or will they just charge on computation hours irrespective of Operating System?
Do we have complete control (like dedicated server) on cloud instance to install any other softwares?
Do we need to host web server and and database server on multiple instances when traffic is increasing or will a big size instance can handle huge traffic?
Please help me on taking a decision by clarifying above.

AppHarbor is like Heroku for ASP.NET and has a free plan (like Heroku) that includes a MSSQL database and Git based deployment. You may want to check them out.

Depends on the provider. Windows almost always has an additional cost fue to licensing.
Again, depends on the provider. Amazon EC2 and Rackspace Cloud both give you root on the instance.
Depends where your bottleneck is. If CPU and memory are in acceptable ranges, but the site runs slowly, you'll need more instances to handle the network demand. If network is fine but CPU or memory are high, a bigger instance may suffice, up to a point.

PHPFog
EngineYard
pagodabox
All of the above have free plans to start with.

If you're looking for something like Google AppEngine or Heroku for PHP you might wanna try our service http://cloudcontrol.com

i am using phpfog.com, works great, fast, and cheap

i think what your looking for is a service that Google gives, that i think is amazing, they made a cloud solution to your problem where you don't have to worry about traffic and server issues, they balance the traffic of all the projects they are hosting.
The best think about it is that you can start free, and then if your app is very popular and you need more bandwidth usage, they charge, you can check the destails here:
http://code.google.com/appengine/
they only disadvantage for you is that it is mainly in java and you need to learn there framework, but i have heard of proyects that allow you to creat your site in php
But if you want to buy a server i recomend
http://mediatemple.net/
i have tried there service and the have virtual servers, and you have full control and if you need more servers you can extend your project, since its cloud based.
hope this helps

Depending on which provider you choose, you may pay for hours your instance is live, or you may pay for actual CPU usage. Eg:
With Amazon EC2, you pay for hours your instance is up (Windows does cost a little more, but it's built-in and paid by Amazon, though there is an option to bring your own licences)
With Windows Azure, you pay for hours your instance is up
With Google App Engine, you pay for actual CPU time (and get 6.5 hours/day free)
Again, this depends on the provider, eg.:
With Amazon EC2, you have full control over the instance, so you can install anything you like (presumably the ToS has exceptions, eg. for unlicensed software)
With Google App Engine, you can use third party libraries, but you cannot "install" things. You don't get instances in the same way as a VPS, they deal with taking your code and making it run across their infrastructure.
I presume Windows Azure works similarly to App Engine here, and you don't have an actual OS install that you could install software in.
You guessed it, this depends on the provider, eg.:
With Windows Azure, you would need to add additional instances to handle increases in load.
With Amazon EC2, you also need to add additional instances. They have services like Autoscaling and Elastic Load Balancing to make this easier (Autoscaling boots up/shuts down instances based on load).
With Google App Engine, you don't need to do anything. Google will automatically fire up new instances as required, and you will pay only for the additional resources in the same way.
There are many factors influencing which would work out cheapest (in terms of development costs, managing servers, Windows licensing, etc.), so it's hard to say which would be best. You'd need to look at each one and estimate costs. I'm trying to do a similar thing for my small projects, some of the info here might be useful: http://blog.dantup.com/2010/10/google-app-engine-gae-vs-amazon-elastic-computing-ec2-vs-microsoft-azure

I'm using AppFog for my applications, they support various platforms, such as Java, PHP and Python, once you're using them, updating your application and mapping it to a url is a breeze and very quick. they also support different services such as MySQL and MongoDB.

Related

AWS What specs Instance do I need for an online game server to host 100,000 or more people?

I am currently leaning towards the AWS EC2 server. I'm looking at the console right now in which i can host my apis and database.
My question is which instance type should i use?
Which database should be used? RDS or on same instance?
Game will have more than 100k users.
Apis are for authentications and user file saving and retrieval.
sincere suggestions required.
thanks
Nobody will be able to give you an answer to this question. And if they do, they will be wrong.
The only way to know what resources a system would consume is to build it, then test it using simulated load. This will help identify the bottlenecks in the system (disk? database? memory? network throughput?).
You will then begin the iterative process of finding the worst bottleneck, rearchitecting the app or changing system components, celebrating, then repeating the whole test-measure-fix cycle. Welcome to the exciting world of application performance management!
You can also take advantage of the Cloud by scaling your resources based upon load. When the system is busy (eg in the evening), add more capacity. When things are quiet, remove resources to save money. This is exactly what Fortnite does.
See: How would you keep 125 million gamers playing smoothly online? Epic Games shares its Fortnite story. | Amazon Game Tech Blog
Depending upon what data you wish to store, you could consider using Amazon GameLift:
Amazon GameLift is a fully managed service for deploying, operating, and scaling your session-based multiplayer game servers in the cloud. Amazon GameLift replaces the work required to host your own game servers, including buying and setting up hardware, and managing ongoing activity, security, storage, and performance tracking. The Amazon GameLift auto-scaling capabilities provide additional protection from having to pay for more resources than you need, while helping to ensure that your players can find and join games with minimal waiting.
In reading your question, I suspect that your application has not yet been written yet. So, it's a good time to make general architectural decisions (eg using DynamoDB instead of a relational database since it provides fast and predictable performance with seamless scalability), but don't worry too much about minor details. First, you need to make a product that people want to use. That will be a more difficult challenge than scaling to meet eventual demand.
Concentrate on getting your first 100 users and worry about the other 100,000 later.
The question is very subjective to answer. Reason is You need to identify below things before coming to conclusion:
How much CPU per user per month is required?
How much memory is required per user per month?
How much bandwidth you required per user per month?
Once you have an idea about these value, May be you should take a look at how many concurrent users you want your server to give service, before scaling to launch another server.
So for example your website have 50000 users consistently accessing your application, then you should choose ec2 instance accordingly followed by auto-scaling group and load balancer to serve your traffic.
For database you should always go with RDS (For relational DB).DB on EC2 instance is not recommended.
For EC2 Instance types please check instance-types

Scalability and fault tollerance servers. How do it?

In our project we have a front-end part with PHP and Apache, a MySQL database and some Mono servers that do some logic (chat, etc...)
It's all completed but before starting and buy the servers i want know how make them scalable and be fault tollerance. We want buy the servers on So You Start.
How can we proceed? What we must buy (possible cheap)? We thinked about a virtualization but we don't know how move.
Thank you in advance.
Amazon has a lot of very good documentation about how to architect their cloud services. I would suggest you start with a free (for 1 year) Usage Tier for learning AWS and testing your application. The free tier It enables you to setup a Unix and Windows instance as well as RDS (Relational Database Server) and email service. You can later add fail-over servers located in geographically dispersed locations. You can also scale easily by adding (and removing) instances as needed.
Start with this overview.
In AWS you can start small and then use AutoScaling with ELB and cloudfront to really scale up as needed.
http://dailytechscape.com

How to test PHP social networking scalability

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.
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:
Caching with Memcached or Redis.
Load balancing.
Switching from Apache to Nginx.
Providing a proper CDN.
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).
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.

PHP server for Android turn based multiplayer game? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
I developed a turn based game for Android, and now I want to add multiplayer gaming. I don't want to use providers like "skiller", I would like to develop my own server.
I don't have a dedicated server, but I have a php hosting with "1 and 1". Would be a good idea to use this hosting like a game server? My idea is that my Android game polls server every X seconds waiting for opponent move.
What do you think about it?
I have looked into using them for hosting and I have heard great things about their support. BUT unless your using a dedicated server that they offer (instead of the base level shared hosting service) you probably won't have the resources available to support a gaming server.
If you can handle doing the server config yourself or are good with detailed instructions on how to set one up then I highly recommend using the $20 a month linode.com base plan. I am using it for site hosting and it makes a huge difference in terms of performance and flexibility. Also I have seen some performance benchmark comparisons done between it, slicehost, rackspace, and Amazon S3 and it blew all of them (especially Amazon) out of the water. The benchmark is 2 or 3 years old, but it is still rather telling.
Linode will let you do ANYTHING you want within the bounds of the law with the server. So if you want to host an adult site they won't have a problem with it. They will probably have a problem with setting up a spam server or some shady things like that. But they are cool with everything else it seems. Plus they are probably the most affordable option out there.
I would add that you may look into the technology behind APE servers (AJAX Push Engine). Its a high efficiency chat system that works with pretty much any server-end language and front-end.
http://www.ape-project.org/
this is how I would do it, since your game is asking the server for pull request lets skip one step. Thats asking the MySQL server. So here is the way I would do it.
From what it sounds like its a html5 game meaning that you could set cookies, on the users phone. I would have a cookie or even a javascript var that then stores a JSON or ARRAY string. from this you would be able to push 1 or 0 to the PHP script that hopefully would be able to send it to the user or store it as a .txt files it is known that fetching data from mysql is slower and if you have 400 users all doing it at 5second intervals you will bring down most shared servers, They are just not strong enough to do what you want.
If your budget is small may I suggest you look this option. I cant really think of away you can do this without storing the data somewhere.
You should not listen to programming language specific arguments, most of the time they are personal preferences. What you want to do is of course possible with PHP. You can do good and bad programming in every language. For a turn based game PHP is totally sufficient, if you know how to use it. Use the programming language you are most comfortable with, and you will be just fine.
What is more important: You want your game to be successful, 1und1 is not capable of handling a way of "success", because of its localized and not scalable on demand nature. If you want to gain money or spread, you really should not fear to invest some low bucks and go for Amazons infrastructure. You will have to learn a little, but it is definitely worth it.
Most IDEs (Zend Studio, PHP Storm, ...) even have good integration already. A shared hoster or a localized storage hoster is not what you want, because if your app gets famous they simply will not be able to handle global demand. And you will have security problems. If you really expect your game to be successful, even a VPS will reach its limit almost immediately.
You can try to grow your game by using 1und1 first, and upon demand going to a better solution. But quite some games just died because the demand was much higher than expected. The worst thing about this is you have to think less euphoric but more realistic.
To sum it up: Just use the language you are most comfortable with, if you believe in your idea do not fear to invest little bucks to meet the global market, create your own protocol with as less data transfer as possible, and please poll more often than "x seconds", because a second waiting for the opponent feels like three days. And you are on your way.
Good progress! And post a link when you're done:)
You can use Firebase messaging service to implement the same. Further you have must one Web server (e.g. PHP).
Use your android code to send request to PHP file at web server.
From this web server you can send broadcast message in form of firebase Messaging which will deliver to all devices of your subscribed topic.
All android device those listen for this FCM can respond(depend on parameters set by your code).

Architecture of a PHP app on Amazon EC2

I recently experienced a flood of traffic on a Facebook app I created (mostly for the sake of education, not with any intention of marketing)
Needless to say, I did not think about scalability when I created the app. I'm now in a position where my meager virtual server hosted by MediaTemple isn't cutting it at all, and it's really coming down to raw I/O of the machine. Since this project has been so educating to me so far, I figured I'd take this as an opportunity to understand the Amazon EC2 platform.
The app itself is created in PHP (using Zend Framework) with a MySQL backend. I use application caching wherever possible with memcached. I've spent the weekend playing around with EC2, spinning up instances, installing the packages I want, and mounting an EBS volume to an instance.
But what's the next logical step that is going to yield good results for scalability? Do I fire up an AMI instance for the MySQL and one for the Apache service? Or do I just replicate the instances out as many times as I need them and then do some sort of load balancing on the front end? Ideally, I'd like to have a centralized database because I do aggregate statistics across all database rows, however, this is not a hard requirement (there are probably some application specific solutions I could come up with to work around this)
I know this is probably not a straight forward answer, so opinions and suggestions are welcome.
So many questions - all of them good though.
In terms of scaling, you've a few options.
The first is to start with a single box. You can scale upwards - with a more powerful box. EC2 have various sized instances. This involves a server migration each time you want a bigger box.
Easier is to add servers. You can start with a single instance for Apache & MySQL. Then when traffic increases, create a separate instance for MySQL and point your application to this new instance. This creates a nice layer between application and database. It sounds like this is a good starting point based on your traffic.
Next you'll probably need more application power (web servers) or more database power (MySQL cluster etc.). You can have your DNS records pointing to a couple of front boxes running some load balancing software (try Pound). These load balancing servers distribute requests to your webservers. EC2 has Elastic Load Balancing which is an alternative to managing this yourself, and is probably easier - I haven't used it personally.
Something else to be aware of - EC2 has no persistent storage. You have to manage persistent data yourself using the Elastic Block Store. This guide is an excellent tutorial on how to do this, with automated backups.
I recommend that you purchase some reserved instances if you decide EC2 is the way forward. You'll save yourself about 50% over 3 years!
Finally, you may be interested in services like RightScale which offer management services at a cost. There are other providers available.
First step is to separate concerns. I'd split off with a separate MySQL server and possibly a dedicated memcached box, depending on how high your load is there. Then I'd monitor memory and CPU usage on each box and see where you can optimize where possible. This can be done with spinning off new Media Temple boxes. I'd also suggest Slicehost for a cheaper, more developer-friendly alternative.
Some more low-budget PHP deployment optimizations:
Using a more efficient web server like nginx to handle static file serving and then reverse proxy app requests to a separate Apache instance
Implement PHP with FastCGI on top of nginx using something like PHP-FPM, getting rid of Apache entirely. This may be a great alternative if your Apache needs don't extend far beyond mod_rewrite and simpler Apache modules.
If you prefer a more high-level, do-it-yourself approach, you may want to check out Scalr (code at Google Code). It's worth watching the video on their web site. It facilities a scalable hosting environment using Amazon EC2. The technology is open source, so you can download it and implement it yourself on your own management server. (Your Media Temple box, perhaps?) Scalr has pre-built AMIs (EC2 appliances) available for some common use cases.
web: Utilizes nginx and its many capabilities: software load balancing, static file serving, etc. You'd probably only have one of these, and it would probably implement some sort of connection to Amazon's EBS, or persistent storage solution, as mentioned by dcaunt.
app: An application server with Apache and PHP. You'd probably have many of these, and they'd get created automatically if more load needed to be handled. This type of server would hold copies of your ZF app.
db: A database server with MySQL. Again, you'd probably have many of these, and more slave instances would get created automatically if more load needed to be handled.
memcached: A dedicated memcached server you can use to have centralized caching, session management, et cetera across all your app instances.
The Scalr option will probably take some more configuration changes, but if you feel your scaling needs accelerating quickly it may be worth the time and effort.

Categories