SHARE
TWEET
smartbuild.php
a guest
Jan 30th, 2016
9
Never
- 11:59:07 czaks copypaste: i believe the smart_build is now 50% fieldtested :^)
- 12:00:36 czaks the remaining things are to add public_banlist support
- 12:00:40 czaks and, possibly
- 12:00:55 czaks deal with this race condition
- 12:01:06 ~copypaste i don't understand how it works really, and how it is faster than the fascgi thing you already did
- 12:01:44 czaks copypaste: well, it's pretty easy
- 12:01:49 czaks when a rebuild happens
- 12:02:03 czaks instead of rebuilding, we just remove the files we wanted to rebuild
- 12:02:06 czaks no generation happens etc.
- 12:02:11 czaks THEN
- 12:02:22 czaks we install /smart_build.php as a 403 and 404 error handler
- 12:02:32 czaks so if a file doesn't exist yet
- 12:02:33 ~copypaste and that does the generation
- 12:02:34 ~copypaste nice
- 12:02:38 czaks yeah
- 12:02:50 ~copypaste that's very clever actually
- 12:03:05 czaks except that there is a race condition
- 12:03:25 czaks well, not that we didn't have race conditions :^)
- 12:03:39 czaks let's think about two people creating a post at the same time (~1ms)
- 12:03:56 czaks so we actually build the htmls twice
- 12:03:57 ~copypaste lol
- 12:04:07 czaks we have some locking implemented but
- 12:04:16 czaks that's only on write
- 12:04:34 czaks so we waste time and interesting things would happen if the later post gets html
- 12:04:38 czaks instead of the former post
- 12:04:44 czaks this is the current situation
- 12:04:57 czaks with smart build, the htmls are generated on runtime
- 12:05:10 czaks so, well
- 12:05:14 czaks let's suppose i do a post
- 12:05:28 czaks and 1000 people go to see the post at the same time
- 12:05:38 czaks the server now spawns 1000 processes to do the generation
- 12:05:40 linear that's a nice idea yeah.
- 12:05:56 czaks it's easy to fix
- 12:06:03 czaks i have a projected solution
- 12:06:14 czaks but what if
- 12:06:29 czaks 1000 people access a post
- 12:06:34 czaks so we do it this way
- 12:06:40 czaks 1st person does the generating
- 12:06:49 czaks the rest are waiting for 1st person to generate
- 12:06:56 czaks and are served the page afterwards
- 12:07:16 czaks what if between those situations a new post appears
- 12:07:34 czaks we won't be able to interrupt existing generation
- 12:08:09 czaks but we will be able to interrupt the waiters
- 12:08:23 czaks and the next person who accesses the website does actual generation
- 12:09:24 czaks i will tomorrow think about a solution
- 12:09:26 czaks good night
- 12:09:26 czaks xD
RAW Paste Data
