Posted by Nigel Graham 2 on 18/04/2021 09:06:23:
… I posted mine before any others had appeared on the screen, but Clive's was inserted above mine.
Looking at the posting times, Clive's was received first but evidently there are odd delays somewhere in the system, and I am at a loss to work out what and where.
I have noticed this effect several times on the forum, sometimes making a particular discussion less coherent…
I notice it too. Doesn't help I'm a slow thinker and worse typist, but there's definitely something odd going on! Most likely explanation is buffering. In order to minimise network traffic and reduce server load, web pages are remembered at various points in the infrastructure and used unless something signals they are 'dirty' and forces a refresh.
- Web pages are remembered locally by the browser – retrieving them is blazing fast because there's no need to connect to a remote server over the internet and wait for the packets to chug round the world.
- Web pages can also be remembered at various points inside the internet. For example, if 10000 UK users connect to the US copy of the Google Home page, then it pays to retrieve the page once from the USA, and then serve 9999 users from the UK copy.
- Servers go to extreme lengths to buffer requests. Their worst case is a large user base randomly reading web pages, thus forcing the server to retrieve data from a hard-disc, or even worse, an archive system. A large web-server will be front-ended by an Internet Accelerator, which is a machine dedicated to serving common pages as fast as possible without bothering the real web-server just behind the scenes. The real web-server also buffers common pages in the same way, and it also buffers memory(which could be data or programs) in several layers:
- Fastest memory is the machine registers, but there aren't many of them. Compilers and schedulers attempt to keep data in the registers for as long as possible.
- Most computers have up to three levels of on-chip cache memory available, each bigger, but slower than the lower level. The idea is that if the required data, or instructions, aren't in a register, they can be quickly retrieved from a fast cache, only then reading RAM, and only reading disc or connecting to the internet if the information isn't available in one of the buffers.
- Discs (including SSDs), also buffer data internally. For example when a program reads a sector containing part of a file, the disc controller, provided it has enough spare memory, will read several sectors ahead as a single operation, hoping to satisfy the next read request from memory, thus saving time expensive reads. The same sort of technique is used by web-servers; if a page is read containing links to other pages on the same web-site, it might buffer those pages as well in the hope the user will click on them as well.
So, for performance reasons, web-pages are fast copies rather than originals, unless they have changed in the meantime. What could possibly go wrong?
Lots! The system as a whole has to deal with out-of-date buffers. Sometimes this is automatic and fool-proof, sometimes a configuration choice. One way is simply time expire slowly changing web-pages, that is the buffer is told the data is valid for say, 10 minutes, after which it should refresh on the next read. This method is very efficient. The other extreme is to configure buffers to always refresh; these are guaranteed to be up-to-date but the entire system works much harder, and slower. Other ways of managing buffers are available, basically allowing the network, web, and system administrators to each tune their bit. They have the opportunity to get it wrong!
Malfunction is always possible too: it's complicated. As all the computers between the home computer and the website's physical data have buffers, a system glitch can cause an out of date buffer to be served without being refreshed. Fortunately, such errors are self-correcting.
Ordinary information sharing websites like this forum are usually configured for performance rather than data integrity, because slightly peculiar behaviour with posts doesn't matter much. Websites handling transactions are much more careful, at least in the parts of the site were it matters. Many websites are a mixture, being gung-ho on buffering slowly changing pages like Terms and Conditions, and ultra-careful when taking orders.
Just a guess – I don't know – but I suspect the forum is configured with time-out buffering, so that Nigel and I briefly work on a copy after other users have updated the original, leaving the buffer chain 'dirty' but not full refreshed end-to-end. Later, Nigel and I get the refreshed version, showing other people hit 'Add Posting' before we did.
Whether this a feature or bug depends on who you are. When I ran web-servers, it was important to give a large numbers of users a reasonable service without spending a fortune on a gigantic server farm packed with high-end computers and a massive network pipe. Difficult compromises were called for! Now I'm an ordinary user I have no sympathy with IT Managers – it's their job to keep me happy at all times, and I don't care if they have to bankrupt the company doing it!
Dave