OriolNews Portal: Lowering the system load
Translation of the original in Catalan. Read it in: CatalàCastellano
Part 5 of 14OriolNews Portal
- OriolNews Portal - v.0.0.1 Inital Release
- OriolNews Portal - v.0.0.2
- OriolNews Portal - Clock ok?
- OriolNews Portal - v.0.0.3
- OriolNews Portal: Lowering the system load
- OriolNews Portal: Black week
- OriolNews Portal: +URL's
- OriolNews Portal:RDF Summaries
- OriolNews Portal: Searches
- OriolNews Portal: SDMS
- OriolNews Portal: v0.0.4
- OriolNews Portal: systems
- OriolNews Portal: v0.0.5
- OriolNews Portal: 1st ANNIVERSARY!!!
Despite having a huge number of things to fix in the PHP code of the OriolNews Portal I have had an idea so that the system load can be lowered considerably and to avoid saturations of the machine in the event of a DDOS attack.
The idea is very simple. Every time someone connects to the portal a connection is made to the MySQL database and a SELECT is made to look for which news items must be shown as the most recent. This makes access to the main page of the portal slower and slower and makes the load very big, since again and again this page is returned to and again and again the same query is being made to the database.
Well then, knowing this problem it has occurred to me to make an RDF (XML) file with the data of the portal news items that must be published as soon as you connect, so the portal, when it shows the index, the only thing it has to do is turn this RDF file into HTML and the system works much less.
This change means that when there is any modification of the contents of the latest news items of the portal the RDF summary has to be modified, the moments when this updating function should be added are:
+USER LEVEL:
--When a comment is sent. The number of comments of the article has to be updated.
+ADMINISTRATOR LEVEL:
--When adding, modifying, deleting and accepting a new article.
After making these changes it is obvious that the processing time of the server to show the main page of the portal will be much lower than the current one. Since MySQL loads the system considerably.