(08-15-2018, 12:58 PM)PaulC Wrote: Hi Pertti, thanks for that. We are currently running 5.6 but I can see going to 7 might be a good move.
Yeah, PHP7 is sweet, gives you couple of nice new features, but without a change, your PHP code, in 99.9% of cases, runs faster and more efficiently. I don't remember running into any issues when we upgraded.
(08-15-2018, 12:58 PM)PaulC Wrote: Can I ask you what you mean by request please? For example, if in our code we direct to another controller and render a page accordingly is that equivalent to a new request (which I assume you mean is from the browser??). In this case are we still running the original php process or another one?
So yes, one request is when you type the URL in your browser, and browser then asks server to give it something, based on that URL.
If URL is pointing to a PHP script (either directly, with myfile.php in URL, or in-directly via .htaccess URL rewrite), web server knows to use PHP library to process the script and send back output of that script.
The way Apache and PHP work, by default you have one system process per request, the moment PHP script is done, that process is killed. Because that setup, A + PHP automatically make use of multi-core CPUs, so requests can be processed concurrently.
It's possible to do multi-threading with PHP, apparently, but by default single script with all it's includes or any cross model/controller linking and what not, will run inside single system process.
If you use "redirect" instruction in your script, PHP script sends special message back to browser instead of your normal HTML and stops, killing the original process, then browser goes - oh, I am suppose to load this other URL instead, and makes a second request with different URL.
(08-15-2018, 12:58 PM)PaulC Wrote: Hopefully you can see my confusion/ignorance!
Eh, all good, I've done this years for bread and butter, and I
still don't know anything
If memory is your problem, are you running your DB server on the same machine as your web server?
It could be that you have queries that are joining together multiple tables and loads of data, that could easily cause some memory issues as some of this data need to be hold in memory while processed by DB server, before it's returned to PHP.