Changeset 196195 in webkit


Ignore:
Timestamp:
Feb 5, 2016 3:55:58 PM (8 years ago)
Author:
rniwa@webkit.org
Message:

Testing with remote server cache is unusably slow
https://bugs.webkit.org/show_bug.cgi?id=153928

Reviewed by Chris Dumez.

Don't use the single process mode of httpd as it's way too slow even for testing.
Also we'll hit a null pointer crash (http://svn.apache.org/viewvc?view=revision&revision=1711479)

Since httpd exits immediately when launched in multi-process mode, remote-cache-server.py (renamed from
run-with-remote-server.py) now has "start" and "stop" commands to start/stop the Apache. Also added
"reset" command to reset the cache for convenience.

  • Install.md: Updated the instruction.
  • config.json: Fixed a typo: httpdErro*r*Log.
  • tools/remote-cache-server.py: Copied from Websites/perf.webkit.org/tools/run-with-remote-server.py.

Now takes one of the following commands: "start", "stop", and "reset".
(main):
(start_httpd): Extracted from main.
(stop_httpd): Added.

  • tools/remote-server-relay.conf: Removed redundant (duplicate) LoadModule's.
  • tools/run-with-remote-server.py: Removed.
Location:
trunk/Websites/perf.webkit.org
Files:
4 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Websites/perf.webkit.org/ChangeLog

    r196190 r196195  
     12016-02-05  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Testing with remote server cache is unusably slow
     4        https://bugs.webkit.org/show_bug.cgi?id=153928
     5
     6        Reviewed by Chris Dumez.
     7
     8        Don't use the single process mode of httpd as it's way too slow even for testing.
     9        Also we'll hit a null pointer crash (http://svn.apache.org/viewvc?view=revision&revision=1711479)
     10
     11        Since httpd exits immediately when launched in multi-process mode, remote-cache-server.py (renamed from
     12        run-with-remote-server.py) now has "start" and "stop" commands to start/stop the Apache. Also added
     13        "reset" command to reset the cache for convenience.
     14
     15        * Install.md: Updated the instruction.
     16        * config.json: Fixed a typo: httpdErro*r*Log.
     17        * tools/remote-cache-server.py: Copied from Websites/perf.webkit.org/tools/run-with-remote-server.py.
     18        Now takes one of the following commands: "start", "stop", and "reset".
     19        (main):
     20        (start_httpd): Extracted from main.
     21        (stop_httpd): Added.
     22        * tools/remote-server-relay.conf: Removed redundant (duplicate) LoadModule's.
     23        * tools/run-with-remote-server.py: Removed.
     24
    1252016-02-04  Ryosuke Niwa  <rniwa@webkit.org>
    226
  • trunk/Websites/perf.webkit.org/Install.md

    r196190 r196195  
    2929```
    3030
    31 Then run `tools/run-with-remote-server.py`. This launches a httpd server on port 8080.
    32 
    33 The initial few page loads after starting the script could take as much as a few minutes depending on your production sever's configurations
    34 since Apache needs to start a pool of processes. Reloading the dashboards few times should bring the load time under control.
     31Then run `tools/remote-cache-server.py start`. This launches a httpd server on port 8080.
    3532
    3633The script caches remote server's responses under `public/data/remote-cache` and never revalidates them (to allow offline work).
    37 If you needed the latest content, delete caches stored in this directory by running `rm -rf public/data/remote-cache`.
     34If you needed the latest content, delete caches stored in this directory by running `tools/remote-cache-server.py reset`.
    3835
    3936
  • trunk/Websites/perf.webkit.org/config.json

    r194120 r196195  
    2020        "httpdConfig": "tools/remote-server-relay.conf",
    2121        "httpdPID": "tools/remote-server-relay.pid",
    22         "httpdErroLog": "tools/remote-server-relay.log",
     22        "httpdErrorLog": "tools/remote-server-relay.log",
    2323        "url": "http://perf.webkit.org",
    2424        "basicAuth": {
  • trunk/Websites/perf.webkit.org/tools/remote-cache-server.py

    r196191 r196195  
    33import json
    44import os
     5import shutil
    56import subprocess
     7import sys
    68import tempfile
    79
    810
    911def main():
     12    if len(sys.argv) <= 1:
     13        sys.exit('Specify the command: start, stop, reset')
     14
     15    command = sys.argv[1]
     16
    1017    with open(abspath_from_root('config.json')) as config_file:
    1118        config = json.load(config_file)
    12         cache_dir = abspath_from_root(config['cacheDirectory'])
    13         httpd_config_file = abspath_from_root(config['remoteServer']['httpdConfig'])
    14         httpd_pid_file = abspath_from_root(config['remoteServer']['httpdPID'])
    15         httpd_error_log_file = abspath_from_root(config['remoteServer']['httpdErroLog'])
    16         doc_root = abspath_from_root('public')
    1719
     20    cache_dir = abspath_from_root(config['cacheDirectory'])
     21    if command == 'start':
    1822        if not os.path.isdir(cache_dir):
    1923            os.makedirs(cache_dir)
    2024        os.chmod(cache_dir, 0755)
    2125
    22         httpd_mutax_dir = tempfile.mkdtemp()
    23         try:
    24             subprocess.call(['httpd',
    25                 '-f', httpd_config_file,
    26                 '-c', 'PidFile ' + httpd_pid_file,
    27                 '-c', 'Mutex file:' + httpd_mutax_dir,
    28                 '-c', 'DocumentRoot ' + doc_root,
    29                 '-c', 'ErrorLog ' + httpd_error_log_file,
    30                 '-X'])
    31         finally:
    32             os.rmdir(httpd_mutax_dir)
     26        start_httpd(config['remoteServer'])
     27    elif command == 'stop':
     28        stop_httpd(config['remoteServer'])
     29    elif command == 'reset':
     30        shutil.rmtree(cache_dir)
     31    else:
     32        sys.exit('Unknown command: ' + command)
     33
     34
     35def start_httpd(remote_server_config):
     36    httpd_config_file = abspath_from_root(remote_server_config['httpdConfig'])
     37    httpd_pid_file = abspath_from_root(remote_server_config['httpdPID'])
     38    httpd_error_log_file = abspath_from_root(remote_server_config['httpdErrorLog'])
     39    httpd_mutex_dir = abspath_from_root(remote_server_config['httpdMutexDir'])
     40
     41    if not os.path.isdir(httpd_mutex_dir):
     42        os.makedirs(httpd_mutex_dir)
     43    os.chmod(httpd_mutex_dir, 0755)
     44
     45    doc_root = abspath_from_root('public')
     46
     47    # don't use -X since http://svn.apache.org/viewvc?view=revision&revision=1711479
     48    subprocess.call(['httpd',
     49        '-f', httpd_config_file,
     50        '-c', 'PidFile ' + httpd_pid_file,
     51        '-c', 'Mutex file:' + httpd_mutex_dir,
     52        '-c', 'DocumentRoot ' + doc_root,
     53        '-c', 'ErrorLog ' + httpd_error_log_file])
     54
     55
     56def stop_httpd(remote_server_config):
     57    httpd_pid_file = abspath_from_root(remote_server_config['httpdPID'])
     58    if not os.path.isfile(httpd_pid_file):
     59        sys.exit("PID file doesn't exist at %s" % httpd_pid_file)
     60
     61    with open(httpd_pid_file) as pid_file:
     62        pid = pid_file.read().strip()
     63        print "Stopping", pid
     64        subprocess.call(['kill', '-TERM', pid])
    3365
    3466
  • trunk/Websites/perf.webkit.org/tools/remote-server-relay.conf

    r190645 r196195  
    1717LoadModule alias_module libexec/apache2/mod_alias.so
    1818LoadModule rewrite_module libexec/apache2/mod_rewrite.so
    19 LoadModule mime_module libexec/apache2/mod_mime.so
    2019LoadModule php5_module libexec/apache2/libphp5.so
    21 LoadModule negotiation_module libexec/apache2/mod_negotiation.so
    2220
    2321<Directory />
Note: See TracChangeset for help on using the changeset viewer.