Skip to content

Instantly share code, notes, and snippets.

@kevr
Last active January 9, 2022 08:16
Show Gist options
  • Save kevr/884fb491aaccbf9938214bce69798ad2 to your computer and use it in GitHub Desktop.
Save kevr/884fb491aaccbf9938214bce69798ad2 to your computer and use it in GitHub Desktop.

Feedback(RPC)

Client & Server Hardware

Memory:    RAM: total: 31.29 GiB used: 4.84 GiB (15.5%)
CPU:       Info: Quad Core model: Intel Core i7-7700K bits: 64 type: MT MCP cache: L2: 8 MiB
           Speed: 1877 MHz min/max: 800/4500 MHz Core speeds (MHz): 1: 3010 2: 2985 3: 3024 4: 3015 5: 3115 6: 3063 7: 3068
           8: 3072
Drives:    Local Storage: total: 1.38 TiB used: 245.85 GiB (17.4%)
           ID-1: /dev/nvme0n1 vendor: Samsung model: SSD 960 EVO 1TB size: 931.51 GiB
           ID-2: /dev/nvme1n1 vendor: Samsung model: SSD 960 EVO 500GB size: 465.76 GiB

Data Comparison

Notes:

  • Data ordering is different between Python and PHP; all data compared has been shown to be equivalent.
# Python, type=search (1)
curl 'https://localhost:8444/rpc?v=5&type=search&arg=sprunge'
{"resultcount":2,"results":[{"Description":"Upload data to sprunge.us via stdin","FirstSubmitted":1639464496,"ID":75001,"LastModified":1639464496,"Maintainer":"kevr","Name":"sprunge","NumVotes":0,"OutOfDate":null,"PackageBase":"sprunge","PackageBaseID":75001,"Popularity":0,"URL":"https://github.com/kevr/sprunge","URLPath":"/cgit/aur.git/snapshot/sprunge.tar.gz","Version":"0.6.0-2"},{"Description":"Upload data to sprunge.us via stdin","FirstSubmitted":1640932730,"ID":75007,"LastModified":1640932730,"Maintainer":"kevr","Name":"sprunge-git","NumVotes":0,"OutOfDate":null,"PackageBase":"sprunge-git","PackageBaseID":75004,"Popularity":0,"URL":"https://github.com/kevr/sprunge","URLPath":"/cgit/aur.git/snapshot/sprunge-git.tar.gz","Version":"0.5.r2.g31e8914-1"}],"type":"search","version":5}

# PHP, type=search (1)
curl 'https://localhost:8443/rpc?v=5&type=search&arg=sprunge'
{"version":5,"type":"search","resultcount":2,"results":[{"ID":75001,"Name":"sprunge","PackageBaseID":75001,"PackageBase":"sprunge","Version":"0.6.0-2","Description":"Upload data to sprunge.us via stdin","URL":"https:\/\/github.com\/kevr\/sprunge","NumVotes":0,"Popularity":0,"OutOfDate":null,"Maintainer":"kevr","FirstSubmitted":1639464496,"LastModified":1639464496,"URLPath":"\/cgit\/aur.git\/snapshot\/sprunge.tar.gz"},{"ID":75007,"Name":"sprunge-git","PackageBaseID":75004,"PackageBase":"sprunge-git","Version":"0.5.r2.g31e8914-1","Description":"Upload data to sprunge.us via stdin","URL":"https:\/\/github.com\/kevr\/sprunge","NumVotes":0,"Popularity":0,"OutOfDate":null,"Maintainer":"kevr","FirstSubmitted":1640932730,"LastModified":1640932730,"URLPath":"\/cgit\/aur.git\/snapshot\/sprunge-git.tar.gz"}]}

# Python, type=info (2)
curl 'https://localhost:8444/rpc?v=5&type=info&arg=sprunge'
{"resultcount":1,"results":[{"Conflicts":["sprunge-git"],"Depends":["python","python-requests"],"Description":"Upload data to sprunge.us via stdin","FirstSubmitted":1639464496,"ID":75001,"Keywords":[],"LastModified":1639464496,"License":["GPL2"],"Maintainer":"kevr","Name":"sprunge","NumVotes":0,"OptDepends":["xclip"],"OutOfDate":null,"PackageBase":"sprunge","PackageBaseID":75001,"Popularity":0,"URL":"https://github.com/kevr/sprunge","URLPath":"/cgit/aur.git/snapshot/sprunge.tar.gz","Version":"0.6.0-2"}],"type":"multiinfo","version":5}

# PHP, type=info (2)
curl 'https://localhost:8443/rpc?v=5&type=info&arg=sprunge'
{"version":5,"type":"multiinfo","resultcount":1,"results":[{"ID":75001,"Name":"sprunge","PackageBaseID":75001,"PackageBase":"sprunge","Version":"0.6.0-2","Description":"Upload data to sprunge.us via stdin","URL":"https:\/\/github.com\/kevr\/sprunge","NumVotes":0,"Popularity":0,"OutOfDate":null,"Maintainer":"kevr","FirstSubmitted":1639464496,"LastModified":1639464496,"URLPath":"\/cgit\/aur.git\/snapshot\/sprunge.tar.gz","Depends":["python","python-requests"],"OptDepends":["xclip"],"Conflicts":["sprunge-git"],"License":["GPL2"],"Keywords":[]}]}

Benchmarks

The following collection of output was produced using oha -z 1min -c 6 ..., which specifies using 6 cpu threads for one minute.

Additionally, the server is configured to use gunicorn with 5 workers; our PHP server is configured to use php-fpm with 5 workers (default). This is as close of a comparison we can get with the different software stacks used.

More-so, keep in mind, these benchmarks are quite specific to this single package which does not have too many related records. We should get benchmark runs against more complicated (or more flexible) queries to assess performance comparisons in these different repeatable paths.

Variables used with Docker:

  • FASTAPI_BACKEND=gunicorn
  • FASTAPI_WORKERS=5
# Python @ /rpc?v=5&type=search&arg=sprunge (1)
Summary:
  Success rate:	1.0000
  Total:	60.0026 secs
  Slowest:	0.4207 secs
  Fastest:	0.0916 secs
  Average:	0.1563 secs
  Requests/sec:	38.3483

  Total data:	1.74 MiB
  Size/request:	793 B
  Size/sec:	29.70 KiB

Response time histogram:
  0.030 [805] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.060 [784] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.090 [121] |■■■■
  0.120 [139] |■■■■■
  0.150 [138] |■■■■■
  0.180 [157] |■■■■■■
  0.209 [119] |■■■■
  0.239 [26]  |■
  0.269 [4]   |
  0.299 [7]   |
  0.329 [1]   |

Latency distribution:
  10% in 0.1013 secs
  25% in 0.1109 secs
  50% in 0.1386 secs
  75% in 0.1943 secs
  90% in 0.2547 secs
  95% in 0.2813 secs
  99% in 0.3102 secs

Details (average, fastest, slowest):
  DNS+dialup:	0.0793 secs, 0.0660 secs, 0.0917 secs
  DNS-lookup:	0.0001 secs, 0.0001 secs, 0.0001 secs

Status code distribution:
  [200] 2301 responses

# PHP @ /rpc?v=5&type=search&arg=sprunge (1)
Summary:
  Success rate:	1.0000
  Total:	60.0056 secs
  Slowest:	0.3140 secs
  Fastest:	0.0998 secs
  Average:	0.1642 secs
  Requests/sec:	36.4799

  Total data:	1.69 MiB
  Size/request:	809 B
  Size/sec:	28.82 KiB

Response time histogram:
  0.019 [181] |■■■■■■■■■■
  0.039 [326] |■■■■■■■■■■■■■■■■■■■
  0.058 [506] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.078 [543] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.097 [295] |■■■■■■■■■■■■■■■■■
  0.117 [182] |■■■■■■■■■■
  0.136 [87]  |■■■■■
  0.156 [37]  |■■
  0.175 [17]  |■
  0.195 [11]  |
  0.214 [4]   |

Latency distribution:
  10% in 0.1218 secs
  25% in 0.1413 secs
  50% in 0.1609 secs
  75% in 0.1828 secs
  90% in 0.2083 secs
  95% in 0.2257 secs
  99% in 0.2658 secs

Details (average, fastest, slowest):
  DNS+dialup:	0.0265 secs, 0.0100 secs, 0.0351 secs
  DNS-lookup:	0.0000 secs, 0.0000 secs, 0.0000 secs

Status code distribution:
  [200] 2189 responses

# Python @ /rpc?v=5&type=info&arg=sprunge (2)
Summary:
  Success rate:	1.0000
  Total:	60.0023 secs
  Slowest:	0.1664 secs
  Fastest:	0.0109 secs
  Average:	0.0231 secs
  Requests/sec:	259.6736

  Total data:	8.02 MiB
  Size/request:	540 B
  Size/sec:	136.94 KiB

Response time histogram:
  0.005 [5524] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.011 [2558] |■■■■■■■■■■■■■■
  0.016 [2782] |■■■■■■■■■■■■■■■■
  0.021 [2576] |■■■■■■■■■■■■■■
  0.027 [906]  |■■■■■
  0.032 [656]  |■■■
  0.037 [230]  |■
  0.042 [110]  |
  0.048 [63]   |
  0.053 [48]   |
  0.058 [128]  |

Latency distribution:
  10% in 0.0139 secs
  25% in 0.0152 secs
  50% in 0.0200 secs
  75% in 0.0278 secs
  90% in 0.0355 secs
  95% in 0.0405 secs
  99% in 0.0607 secs

Details (average, fastest, slowest):
  DNS+dialup:	0.0301 secs, 0.0064 secs, 0.0784 secs
  DNS-lookup:	0.0000 secs, 0.0000 secs, 0.0001 secs

Status code distribution:
  [200] 15581 responses

# PHP @ /rpc?v=5&type=info&arg=sprunge (2)
Summary:
  Success rate:	1.0000
  Total:	60.0026 secs
  Slowest:	0.0860 secs
  Fastest:	0.0158 secs
  Average:	0.0242 secs
  Requests/sec:	247.7728

  Total data:	7.77 MiB
  Size/request:	548 B
  Size/sec:	132.60 KiB

Response time histogram:
  0.005 [3893] |■■■■■■■■■■■■■■■■■■
  0.010 [6839] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.015 [2857] |■■■■■■■■■■■■■
  0.021 [827]  |■■■
  0.026 [227]  |■
  0.031 [105]  |
  0.036 [55]   |
  0.041 [31]   |
  0.046 [16]   |
  0.052 [6]    |
  0.057 [11]   |

Latency distribution:
  10% in 0.0182 secs
  25% in 0.0207 secs
  50% in 0.0232 secs
  75% in 0.0266 secs
  90% in 0.0305 secs
  95% in 0.0339 secs
  99% in 0.0445 secs

Details (average, fastest, slowest):
  DNS+dialup:	0.0094 secs, 0.0063 secs, 0.0112 secs
  DNS-lookup:	0.0000 secs, 0.0000 secs, 0.0003 secs

Status code distribution:
  [200] 14867 responses

# Python @ /packages (3)
Summary:
  Success rate:	1.0000
  Total:	60.0020 secs
  Slowest:	1.5321 secs
  Fastest:	0.4456 secs
  Average:	0.7320 secs
  Requests/sec:	8.1497

  Total data:	2.93 MiB
  Size/request:	6.14 KiB
  Size/sec:	50.02 KiB

Response time histogram:
  0.099 [116] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.198 [122] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.296 [132] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.395 [20]  |■■■■
  0.494 [4]   |
  0.593 [8]   |■
  0.691 [15]  |■■■
  0.790 [24]  |■■■■■
  0.889 [26]  |■■■■■■
  0.988 [17]  |■■■■
  1.087 [5]   |■

Latency distribution:
  10% in 0.4982 secs
  25% in 0.5556 secs
  50% in 0.6481 secs
  75% in 0.7344 secs
  90% in 1.2218 secs
  95% in 1.3177 secs
  99% in 1.4335 secs

Details (average, fastest, slowest):
  DNS+dialup:	0.0101 secs, 0.0088 secs, 0.0112 secs
  DNS-lookup:	0.0000 secs, 0.0000 secs, 0.0000 secs

Status code distribution:
  [200] 489 responses

# PHP @ /packages (3)
Summary:
  Success rate:	1.0000
  Total:	60.0039 secs
  Slowest:	2.2074 secs
  Fastest:	0.7948 secs
  Average:	1.3280 secs
  Requests/sec:	4.4830

  Total data:	1.45 MiB
  Size/request:	5.53 KiB
  Size/sec:	24.77 KiB

Response time histogram:
  0.128 [4]  |■
  0.257 [20] |■■■■■■■■■
  0.385 [49] |■■■■■■■■■■■■■■■■■■■■■■■
  0.514 [68] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.642 [47] |■■■■■■■■■■■■■■■■■■■■■■
  0.771 [40] |■■■■■■■■■■■■■■■■■■
  0.899 [24] |■■■■■■■■■■■
  1.027 [13] |■■■■■■
  1.156 [2]  |
  1.284 [1]  |
  1.413 [1]  |

Latency distribution:
  10% in 1.0578 secs
  25% in 1.1601 secs
  50% in 1.2922 secs
  75% in 1.4882 secs
  90% in 1.6079 secs
  95% in 1.7280 secs
  99% in 1.9267 secs

Details (average, fastest, slowest):
  DNS+dialup:	0.0738 secs, 0.0612 secs, 0.0880 secs
  DNS-lookup:	0.0001 secs, 0.0000 secs, 0.0001 secs

Status code distribution:
  [200] 269 responses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment