CS174
Chris Pollett
Nov 30, 2016
ab -nSOME_NUM -cCONCURRENCY URL
|fg5:search_yioop:105>ab -n2000 -c3 "http://localhost/git/yioop/?q=google"
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests
Server Software: Apache/2.2.24
Server Hostname: localhost
Server Port: 80
Document Path: /git/yioop/?q=google
Document Length: 328 bytes
Concurrency Level: 3
Time taken for tests: 1.199 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Non-2xx responses: 1000
Total transferred: 553000 bytes
HTML transferred: 328000 bytes
Requests per second: 834.27 [#/sec] (mean)
Time per request: 3.596 [ms] (mean)
Time per request: 1.199 [ms] (mean, across all concurrent requests)
Transfer rate: 450.54 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 3 59.1 0 1084
Processing: 0 0 0.1 0 1
Waiting: 0 0 0.1 0 1
Total: 0 4 59.2 0 1085
Percentage of the requests served within a certain time (ms)
50% 0
66% 0
75% 0
80% 0
90% 0
95% 0
98% 1
99% 1
100% 1085 (longest request)
Pick two of the pages of your Hw3 (not Hw4) solution. For each page, get a transcript of doing 1000 requests to that page using Apache Bench. Try three different settings for the concurrency 1, 10, 100.
Post what you observed to the Nov 30 Discussion Thread.
http://www.cs.sjsu.edu/faculty/pollett/in this network, you used to be able to make a request to:
http://www.cs.sjsu.edu.nyud.net/faculty/pollett/i.e., I tack on .nyud.net to the domain name.
Array( "name" => "Bob", ..., "posts" => Array([0] => Array("title" => "Dark and Stormy Night", ...), [1]=>...))
pecl install Memcachedand then add the line
extension=memcached.so(or .dll on Windows) to your php.ini file and restart everything.
extension=msgpack.so
memcached -d -m 50 -l 127.0.0.1 -p 11211
telnet 127.0.0.1 11211 set foo 0 0 6 lalala STORED
VALUE key flags bytes\r\n data block\r\none for each value returned, followed by an END\r\n after the last value.
get foo VALUE foo 0 6 lalala END
$memcached = new Memcached();
$memcached->addServer($host, $port, $weight);
$memcached->set($key, $val, $expire);
//$expire - Unix timestamp, or seconds from present. 0 -don't expire
$memcached->get($key);
<html>
<head><title>Memcache Test</title></head>
<body>
<h1>Test</h1>
<?php
$memcached = new Memcached();
$memcached->addServer("localhost", 11211);
$memcached->set("bob", "value", 60);
echo "<p>".$memcached->get("bob")."</p>";
?>
</body>
</html>