Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

My situation is this.

I coded in php and built a facebook app. After 3 days it has 13,000 users.

I have my own server at hostmonster. It is a regular plan costing me about $70 per year. It has unlimited bandwidth.

I did not anticipate hosting apps or that it could pick up so many users.

Already 1 Gb of data was transferred in the last few days.

I am planning to build a few more apps(around 10 - 20) and reach atleast a million users in total.

Should I continue hosting on the same server or move to a VPS? I am a student and I don't have too much of a disposable income. So I want to move only if it is necessary.

Right now it shows 1 Gb/infinity in data transfer.

Any help/suggestions highly appreciated.

share|improve this question
    
Congrats - that's pretty impressive after 3 days! What are the limits on your current plan? –  GrandmasterB Feb 9 '11 at 6:36
    
Monthly Bandwidth Transfer 939.6 / ∞ MB 0 File Count 9322 Storing a large number of files on your account can cause a degradation of performance. To see more information see our File Count page. Please note: Your account file count is nearing the excessive limit. Please visit our Terms of Service page for information. NOTICE: Your account file count is over the excessive usage limit. Your account is in danger of becoming deactivated. Please visit our Terms of Service page for information. Email Accounts 1 / ∞ 0 Subdomains 3 / ∞ Parked Domains 0 / ∞ Addon Domains 1 / ∞ FTP Accounts 0 / ∞ –  Redmaverick Feb 9 '11 at 7:03
1  
Hi, do you know what my options are at this point? Just realized that I am nearing my service limits –  Redmaverick Feb 9 '11 at 7:06
    
Can you provide a link to your app? I'm curious to see it. That's a great user adoption rate in a short time. –  John K Feb 9 '11 at 7:21
    
It is not a big app like farmville etc it just targets a narrow demographic of (immature)users. –  Redmaverick Feb 9 '11 at 7:52

3 Answers 3

up vote 1 down vote accepted

It sounds like you have a site where users contribute images, which are stored as files in the server filesystem, and this is the limit your are hitting, no?

I think your safest bet is to refactor your application so that the uploaded files are stored on an external server, where you can easily scale your space/bandwidth limits up and down to match your demand. Take a look at, for example, Amazon S3.

share|improve this answer
    
Can we use php in Amazon S3? Do you have any idea? –  Redmaverick Feb 9 '11 at 8:00
    
I retrieve images based on user's profile. –  Redmaverick Feb 9 '11 at 8:01
    
@Karthik: I don't have much experience with PHP myself, but quick googling came up with this library which sounds like it does what you need: undesigned.org.za/2007/10/22/amazon-s3-php-class –  shang Feb 9 '11 at 8:12
    
@Karthik: Basically, you still run the PHP code on your own server, but upload the images to S3 and link to them there. –  shang Feb 9 '11 at 8:14

If you're worried about disk access, you might cache often used images in RAM and dish them out from there. Of course RAM can start swapping to the hard disk via paging and whatnot. Overall best not to optimize in advance, but there are ways to optimize depending on where problems occur, if they ever do.


(In the comment of another answer you said you don't use a database so I'm moving this down a bit and provided more above.)

If you use a database, and if fb app responsiveness becomes an issue, at that point start caching pages or parts of pages that would otherwise be served from the database, even for just seconds or a minute at at time. Then you will reduce load on the db and waiting time for its processing.

The design and logic of caching will depend on what your app does. Don't optimize in advance because you likely can't anticipate the problems easily or correctly.

share|improve this answer
1  
If I use free service like blogger to host the images and then use the app to publish from external site will it reduce the load on my server? –  Redmaverick Feb 9 '11 at 7:32
    
Yes, you are correct. Good idea! –  John K Feb 9 '11 at 8:13

If I understand your question, you're worried about bandwidth? Or speed?

You really don't need to worry so much about data transfer nearly as much as you need to worry about server load (CPU). If you're script is accessing a database and doing anything processor intensive, CPU will probably be a concern way before bandwidth is.

1GB in 3 days is nothing to worry about. What I would look at it how responsive is your Facebook app. Does it take a while for pages of your app to load? Are there ever any time-outs? If so, that's when you need to start looking for a VPS. You might ask HostMonster if there's a way to monitor CPU usage of your account.

From your description, it sounds like you're in good shape right now. Focus on making your Facebook apps and worry about growing pains a little further down the road. :)

share|improve this answer
    
Speed is not much of a criterion. I am not accessing database. However what I am most concerned is the server crashing. I have a lot of .jpg images in a folder some of which I display on the wall, album etc of the user. –  Redmaverick Feb 9 '11 at 7:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.