0
Hello, I am developing a project and I lack some theoretical and practical knowledge about the operational, requirements and responsiveness of PHP + Mysql.
I am creating the project API initially in PHP and there will be a long pooling that will check the changes made to the server and immediately pass it on to the client if there is any change. I’m thinking of performing this check 1 in 1 second, IE, a query to DB every second for each connected client.
These requests are the ones that will require the most from the system, however, in addition to them there will be other small sporadic consultations. Having this scenario in mind, I thought about starting a simpler hosting and progressing with hardware upgrades according to the project too, however, I’m in doubt how far I could go using PHP + Mysql. I know it can be difficult to make an estimate like this, without anything concrete and without more details of the project, but, will be that I can maintain some 100, 200, 500 clients (queries per second) safely?
Note: These queries to DB (1 per second for each client) will be small and indexed, probably returning a single field with a JSON to update the client if necessary.
You’d have to see what he’s gonna use for technology. If you use "pure" PHP, avoiding unnecessary nonsense like OOP (after all, it is a scripting language for single requests that does not keep state) it is one thing, if you stick these frameworks of fashion and good practices that the kids who adventure in the area without preparation (unfortunately is turning most) like, already need much more machine. I don’t know if this can be handled objectively in the scope of the site, maybe the chat would be more appropriate, since their points allow.
– Bacco
For the record, 500 queries per second is a very low volume of requests, except for something out of the ordinary, it’s not a problem. More details here: PHP and Mysql, as thousands of connections are processed at the same time?
– Bacco
I am using pure PHP, I confess that afraid to let anything go, mainly by XSS and Injection, but, learning to use a framework would take me a lot of time to master it and considerably delay the project, Since it’s something I did for myself and I decided to share it with other people who might need it. But it’s frustrating how php leaned towards the framework side, these days I was looking to implement authentication in 2 factors but only found material for Laravel, code ignate and etc...
– MichellHenrique
Be quiet, because the people who talk that FW avoids this is almost terraplanist. It is even a fallacy that fans of a well-known repeat in the hope of becoming true. So much so that it is always people with no qualifications that propagates it. If the person does not understand fundamentals, will do nonsense with or without FW. Just having these worries, instead of buying the crap blindly, you already show you’re on a better path than most of them. Study intensely always, with an open mind. This is the way to minimize problems, and at the same time have professional solutions if some happen.
– Bacco
I think it’s funny, PHP+Mysql has been the safe port for years and years and suddenly, faster technologies have started to appear, which is great, but it doesn’t make PHP bad and a lot of people don’t understand this. I remember a comparison between PHP and NODEJS in which Node answered let’s say 300k of requests per second and PHP say 150K, then people saying that PHP was slow, hell, 150K/second is a lot, it will be more than enough for many and many cases. Unfortunately people become alienated to certain advertisements rather than focus on what they really need for their project .
– MichellHenrique
Finally, I believe that I should not have problems with PHP + Mysql requests, I will focus on building the production environment and improving what I already have. Thank you very much for the @Bacco clarifications, I am more relaxed to be able to delay a little the replacement of Mysql by Redis (if you really end up having the need) in this specific case. Thanks again.
– MichellHenrique