I have a small Facebook app.
There are 3 main files in it apart from the other files. I used PHP for coding as well as the PHP SDK of Facebook for the API calls.
One of them does the redirection to the facebook login page as well as the fetching of user profile details(like id, name, gender, picture).
Second one is the callback page, to which the FB redirects back after successful login. It is this page where the access token is generated and the session is set.
And the third file is a class file, which is responsible for the generation of the image based on the user's profile data(id, name, gender, picture)
At the moment, the app works without issues. But when the number of users(at a time) goes to 1000+, the server resources seems to be going high. And eventually, the server hiccups and sometimes the page won't be accessible because of it.
Am using Business Pro Cloud Hosting package of Bluehost: [url removed, login to view]
Also 2 cores bought extra too. So total 8 cores with 6GB ram is what my account has.
So, I need someone to check the code and optimize it so that the application won't take too much server resources!
Make sure you tell me what changes you made in the code also.