Line 53: |
Line 53: |
| === Tests === | | === Tests === |
| If not specified, all our tests are made on a Raspberry Pi 4: because of the very low price of it, hardware -- and tests -- are easily reproducible. | | If not specified, all our tests are made on a Raspberry Pi 4: because of the very low price of it, hardware -- and tests -- are easily reproducible. |
| + | |
| + | All tests have been run with: |
| + | * a standard installation, as [https://github.com/openfoodfacts/folksonomy_api/blob/main/INSTALL.md described here] |
| + | * no optimization at all |
| + | * <code>uvicorn</code> launched with 2 workers. |
| + | $ uvicorn folksonomy.api:app --reload --host 192.168.0.42 --workers 2 |
| + | |
| + | We used the classical <code>ab</code> test tool from the Apache Foundation, and a custom script to test new key/value injection (see bellow). |
| | | |
| Testing 10,000 queries to <code>/ping</code> (includes a database request) give the following results: | | Testing 10,000 queries to <code>/ping</code> (includes a database request) give the following results: |
Line 59: |
Line 67: |
| Requests per second: 307.11 [#/sec] (mean) | | Requests per second: 307.11 [#/sec] (mean) |
| Time per request: 32.562 [ms] (mean) | | Time per request: 32.562 [ms] (mean) |
| + | Testing 10,000 queries to a particular key/value gives the following results: |
| + | $ ab -n 10000 -c 10 http://192.168.0.42:8000/product/6389599748279 |
| + | |
| + | Requests per second: 227.45 [#/sec] (mean) |
| + | Time per request: 43.966 [ms] (mean) |
| Publishing 2,000 new key/value pairs on 2,000 different products give the following result: | | Publishing 2,000 new key/value pairs on 2,000 different products give the following result: |
| $ time ./fe_test.sh | | $ time ./fe_test.sh |