Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
im wondering what would happen if a cron job is set to run every minute but the script it runs takes 2 minutes to run? Would it queue itself, ignore runs if previous cron is still running or run the same file simultaniously? Thanks!
The cron will boot up a new PHP process every minute, and they will all operate simultaneously with various terrible results (unless your script is properly guarded against such things, anyway)
After a while, either you'll constantly have a number of simultaneous requests running OR your server will crash after running out of resources, depending on whether or not the scripts start blocking each other due to trying to access restricted resources.
Either way, it probably won't be pretty and it probably won't be what you want.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
so we got hacked and from that we raised a question based on our logs. Can a hacker start uploading a file at one point and specify when should it stop uploading. I.e. we got a HIT from an IP address at 06:50:52 2020-06-19 and the file uploaded later on 2020-06-20. The file is 2Mb so no way it actually took a full day to upload or does it depend on PHP configuration. Also there is no indication on when the file was uploaded only the first HIT was logged.
The client may influence the speed the file is being uploaded. It depends on the configuration of your server whether you timeout such long lasting requests or not. See the slow loris attack example to see how things may work.
you have to find which vulnerabity got exploited. It can be anything from a reverse shell to the webserver gained throu some php vulnerable scripts ...to some WordPress bug. Look thru all the logs
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
Inorder to create a SaaS application..
How many requests PHP can handle per second ?
How to handle millions of requests per second?
What is the best database technology to handle millions of requests?
This has nothing to do with PHP. This is a server-related issue. PHP does not interpret the requests , It's the webserver which does it.
Get a high-precision server that can balance loads of requests. You can also avail for pay-as-you-use services from different webhosting providers.
It's awkward to provide you links for such webhosting services since you can easily google it up and find some of them out. However, r---space and med----mple offers great services (names masked to avoid advertizing)
This is totally hardware dependent. With infinite resources and perfect load balancing PHP can handle all requests that could ever originate in the universe.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I am creating a website and am expecting somewhat normal usage. I am setting up the system for now with 1 Apache Server and 2 DB servers. I want any DB operations to be reflected in both DB servers so that I can have 1 server as Backup. Now how do I do it ?
The ways I can think of are :
Perform same operations in both DB from PHP. This seems like a terrible idea.
Update 1 DB and sync both DB servers periodically. This seems better.
Is there any better way to achieve this ? How is it done in Enterprises ?
If you're using MySQL, there is quite powerful built-in replication.
Check out the docs
A terrible idea is to have backup each time a new operation happens. No modern, nor old application works this way. Even Windows System Restore makes backup on scheduled times, not on each operation.
I'd suggest you to make an sql dump script. And schedule a cron job wich will run it once a day, or twice a day. If you really need the data on the server immediately (assuming, you need if one of the DB servers crashes, your app continue working immediately with the backup server) you can make an import script, which will run once the dump finishes.
If you are not in the special case, when you need once the first DB server is shutdown'd, to have another one opened, you can just store the dumped sql files on the machine and not load them on real database, if they are not needed.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have a question in my mind that if answered can solve my problem.
How does server handle multiple user request for PHP scripts?
For example, if a user open a page that access a PHP script using ajax request, and for instance that PHP script has a long process ( actually very long ) and another more user open the same page in other machines, and another more and more user.
Does the process in PHP needed to be finished first before the second user who access to the script can be handled or will they be handled in parallel way the server?
The web server, say Apache, will launch a new independent PHP process for every request. There may be several instances of PHP executing the same script independently of each other running simultaneously. They do not wait for each other* nor do they interfere with each other**.
* If they are trying to access shared, locked resources simultaneously, they may have to wait for each other. Say, files or sessions.
** Unless of course they modify some external resource (say files or database records) in a way where they interfere.
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
I have a website which hangs about 20 times a day for between one and ten minutes. I have a hosting company who cannot find the problem, I have an application developer who cannot find the problem and they both blame each other. Its the Server, says the developer as is doesnt show on the Dev Server. Its the Application, says the Host, as they can't find any error log issues.
Can anyone offer me a few hours consultancy to get to the cause of the problem?
Best thing to do is - while the server is hanging - check an other page/file on your website/webapplication server. If that opens fine, logic dictates that its not your hosting company. Also check on other computers/internet pages then your own. It could be a local problem. I think you must log all tasks; see what is eating up your connection and/or cpu during the 10 minutes.