-
Notifications
You must be signed in to change notification settings - Fork 37
WebServiceTesting
This page contains some testing of Web Service part. For now, it's only testing before getting all package versions to update to, see diagram of flowchart Web Service receives a list of nevras (name, epoch, version, release, architecture) via POST request, sorts it, makes it unique and send back.
Tested Web Service is implemented in Python/Java/Go (see details of implementation in the particular sections).
Input data format (TODO: extract the description of Input/Output data format to the separate wiki page)
Web Service receives a list of nevras in plain text, one nevra per line. In case if the list has Json/XML format Web Service needs to parse it into plaintext.
See example of file with 100K nevras (only 2481 of them are unique) - nevras
100K nevras is a current limit on processing. Size of this file is 3.4 Mb:
$ ls -lah nevras
-rw-rw-r--. 1 galtukho galtukho 3.4M Dec 19 12:02 nevras
$ time sort -u nevras | cut -d '-' -f 1 > /tmp/prep_nevras
real 0m0.274s
user 0m0.268s
sys 0m0.009s
Testing of the implementation will be in three types of environment:
Environmenmet: Python 2.7.5, Centos 7 x86_64, 4 Gb of RAM, CPU Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz
To run as a usual python application, just execute:
python app.py
in the directory of cloned repository.
Create a file with some number of nevras, or use file nevras
from the repo.
Benchmarking result:
$ ab -n 500 -c 500 -p /path/to/nevras http://127.0.0.1:8080/api/v1/plain/
Server Software: TornadoServer/4.2.1
Server Hostname: 127.0.0.1
Server Port: 8080
Document Path: /api/v1/plain/
Document Length: 84976 bytes
Concurrency Level: 500
Time taken for tests: 15.385 seconds
Complete requests: 500
Failed requests: 0
Write errors: 0
Total transferred: 42562000 bytes
Total body sent: 1762630000
HTML transferred: 42488000 bytes
Requests per second: 32.50 [#/sec] (mean)
Time per request: 15385.179 [ms] (mean)
Time per request: 30.770 [ms] (mean, across all concurrent requests)
Transfer rate: 2701.59 [Kbytes/sec] received
111881.59 kb/s sent
114583.19 kb/s total
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1362 1447.8 507 4602
Processing: 540 7221 3518.5 8101 12473
Waiting: 41 7133 3589.4 8079 12452
Total: 560 8584 3989.2 8333 15333
Note: Time per request: 30.770 [ms]
Build instructions: using Dockerfile, build docker image and run in locally:
docker build -t apptornado . # build docker image with name apptornado
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
apptornado latest 82996a266b39 13 minutes ago 411.2 MB
docker run -p 8080:8080 apptornado
After this step are complete, create a file with some number of nevras, in current test this file is used.
Benchmarking result:
$ ab -n 500 -c 500 -p /path/to/nevras http://127.0.0.1:8080/api/v1/plain/
Server Software: TornadoServer/4.2.1
Server Hostname: 127.0.0.1
Server Port: 8080
Document Path: /api/v1/plain/
Document Length: 84976 bytes
Concurrency Level: 500
Time taken for tests: 17.533 seconds
Complete requests: 500
Failed requests: 0
Write errors: 0
Total transferred: 42562000 bytes
Total body sent: 1762630000
HTML transferred: 42488000 bytes
Requests per second: 28.52 [#/sec] (mean)
Time per request: 17533.314 [ms] (mean)
Time per request: 35.067 [ms] (mean, across all concurrent requests)
Transfer rate: 2370.60 [Kbytes/sec] received
98174.16 kb/s sent
100544.76 kb/s total
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 3819 4060.3 2488 11874
Processing: 2157 9455 3198.8 11676 13197
Waiting: 35 9398 3231.4 11662 13196
Total: 12090 13274 1671.3 12108 17476
Note: Time per request: 35.067 [ms]
There are possible to deployment configuration:
- Source2Image
- Dockerfile
The test uses second deployment configuration (Dokerfile). Instructions to add new build configuration for the app:
oc login https://<FQDN>
cat Dockerfile | oc new-build --strategy=docker --dockerfile=- --to=myapp
oc new-app myapp
oc expose svc/myapp
After steps above are done, there will be two API call available.
The first one is GET request, which is doing nothing and used just for network speed test. Results of executing this request:
$ time curl http://<FQDN>
Example:
curl -F file=@/path/to/file http://<FQDN>:8080/api/v1/plain/
real 0m0.489s
user 0m0.000s
sys 0m0.004s
The second POST request receives file, performs steps and send result back:
time curl -F file=@/home/galtukho/Workspace/biglist <FQDN>/api/v1/plain/ > /tmp/newlist
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3528k 100 87457 100 3442k 27958 1100k 0:00:03 0:00:03 --:--:-- 1100k
real 0m3.135s
user 0m0.002s
sys 0m0.010s
Since the network speed is really slow, there no sense to make load testing with ab