Long story short, I want to make the following 1-line script as fast as it can get:
tail -f access_log | grep -v 'some_requests' --line-buffered | sed -u 's/^.*(http://example.com/blah)/this.html.*$/1/that.html/' | while read line; do wget -bq $line -O /dev/null > /dev/null 2>&1; done
So this is an attempt to warm up some inteal cache when request for 'this.html' comes in to generate a future 'that.html' request for the webserver. The domain inteally resolves to a local address, so the scripts works just fine.
Its only problem is when the server gets very busy and it misses the log lines, so the cache hit suffers. The wget payload does not matter (as you can see it is dumped), just the request needs to be generated so that the body is cached inteally.
What changes can I make to run this faster?
- - , .
برچسب:
نویسنده: استخدام کار