Hello,
I have two simple questions, for the ones that know the situation.
Wich hosts are able to run .exe (or linux executables compiled with gcc/g++ or wtvr)? GoDaddy does? (You’ll hit me hard for saying this but…) I like GoDaddy so far, its true they have ads and garbage, but they’re cheap and simple to use.
How can i convert to C, this PHP so that it outputs the exact same thing?
You’re way ahead of yourself. You’re a CompSci student, I take it they’re not teaching you any Agile development techniques? One of the first premises of Agile development is the tenant: “You aren’t going to need it”.
Essentially, don’t do anything until it actually needs to be done, and when you do do it, only do the simplest thing that could possibly work. You don’t even have an operational website yet, and you’re concerned about how to handle things when you’ve got tens of thousands of users. This is like someone who just bought their first hammer being concerned about how it is that they’re going to design a skyscraper.
There’s nothing saying you won’t build a skyscraper, but it’s far more valuable to focus on the nail you need to pound into the piece of wood in front of you than the skyscraper that might be fifteen or twenty years off. This isn’t 1997; 23 year old kids don’t retire as multi-millionaires anymore. There’s nothing saying that you’re not going to build the next Facebook, but you’re far more likely to get there by focusing on the detailed tasks which are in front of you, instead of worrying about the infrastructure of what your massive application is going to look like. When you need that infrastructure, you’ll have the knowledge (or know how to get it) to make that happen. Worrying about it now is only going to cripple you in the short and long term.
You will not even be able to have thousand users doing a request at the same time on a shared host.
Even on a dedicated server you might get problems there, all depending on your pool of workers. The web server can serve X users at the same time before it will reject requests due to being overloaded.
As mentioned, if you reach a point that you will have thousand real users at the site at any time you have a successful website and should have no problems to pay for a few dedicated web servers and use load balancing.
Do yourself a favor, finish your application in PHP first, then if its as successful as you hope/believe then expand and do the required updates.
As SituationSoap mentioned, I am starting to believe your just doing some trolling, at best its pure ignorance on how things work together.
Yes you’re right, 0.003 milliseconds.
Another pro of compiling my PHP, is that it will prevent any kind of code stealing.
Anyway, if i go for shared hosting, and dont compile my php code, can i, if needed later, compile everything, and migrate to a VPS easily? Or if im thinking about that possibility, i should do it at the very start of the project?
Hmmm, what books would you recomend for managing N servers, and their respective requests load?
Im a computer science and engeneering student, i should be able to handle some of those things, but im still fresh in my server experience, but please dont give me a book from the scratch, i would like some that would go straight to the point, i can learn the basics while i learn what i need. Just need an advice
Countless books has been written on that subject and on how to administrate servers in general. You will either need to buy a bunch of those or take a few courses to learn how to properly do it. Or you can do as most successful businesses would, they “outsource” the work to a company that specialize on server management.
You can also base your application in the “cloud”, but in the long run that will be more expensive than running your own servers. It will be a lot more flexible since you can add/remove servers instantly, but that flexibility cost.
Is not that simple.
I like to learn new things. That’s why i didn’t use a pre-made compiler.
I wanna know everything about speeding up websites. I want to know it all, my site is not online right now, but the code is very complex and slowo operate, and yes, im using logaritmic performance order in almost every algorithm i have there.
My site is about a game, like Ogame, or Tribalwars, etc… And as you see, they require alot of resources to keep it cool. So will i.
You don’t need C. I don’t care what your use case is, you don’t need C (especially if you’re running on a shared host). Facebook recently went to completely compiled code, and their unique monthly user base is a non-trivial percentage of the entire world’s population.
Your application won’t be Facebook. Don’t mean to be harsh, but it sounds like someone needs to talk some sense to you (and I’m not the first in this thread to do it) before you go off chasing something that’s completely irrational.
If you have 1000 people doing simultaneous requests, you have millions of visitors a day. Which means you should be earning enough cash to throw a couple of extra servers and a load balancer at your site.
I am sorry, but I dont really see any reasons for why you need the speed of a C application vs PHP application.
You want to use shared hosting accounts, which means that what the application will be used for does not have a lot of traffic.
If your having performance issues, have you as “hash” mentioned profiled where in the code the bottleneck is? Usually the bottleneck is not the PHP code, but instead a database query etc.
To increase the performance of PHP there is also bytecode cache loaders like APC etc.
I don’t think you understand how web servers work. Is it .003 seconds or milliseconds? If it’s milliseconds, then your math should be that it will take 3 milliseconds to load with a thousand users (which isn’t true).
In reality, those requests are handled in parallel, and because of the incredibly short PHP processing time (3 milliseconds is plenty fast), you’ll see minimal degradation due to simultaneous requests.
At a .003 second processing time, you’re seeing more overhead from the network than the server: it takes almost 50 times as long as that for the average web server to even make a TCP connection.
At this point, I’m starting to wonder whether or not you’re just trolling.
The database is local. And yes, php runs very slowly, just because there will be a huge amount of users acessing the site at the same time, i’ve made stress tests, and php is slow, by other hand, C is very very fast.
My only problem now is, how to make exe’s requests, for example, being mainfile an executable, certainly i cant do this:
But still, using remote servers to do the job, i still get 0.003ms of time generating the page. That’s awful for a website that may have a huge number of requests per second.
If i have 1000 people using it at the same time, it will take 3 seconds to load!!!
No, the page isnt slow, its very fast indeed. I tried to reduce the number of requests (one imagem for all, only one CSS file, some recursive code generated by Javascript (client-side job to spare the server and speeding up html transference), super efficient algorithms, etc…) but i think more can be done.
There is no change you could make in C to speed up your site sufficiently so that you would make up (over the entire life of your website) the amount of time you’ve spent posting in this thread, much less the amount of time spent recoding the application in C.
If you really need a compiled language, something like C#.NET running on a windows IIS server would be a good choice, or something running Java.
The reason you don’t see people writing webpages in C is because C isn’t a web design language. Stop trying to use the wrong tool for the job.
Edit: You’d be much more likely to get good responses if you posted a new thread asking us to help you optimize your code. I have a feeling that if it’s so slow it’s unusable, you’ve got a problem in your design somewhere that you’re just not seeing.