Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faster node endpoint #51

Merged
merged 7 commits into from
May 14, 2024
Merged

Faster node endpoint #51

merged 7 commits into from
May 14, 2024

Conversation

FranciscoLozCoding
Copy link
Contributor

@FranciscoLozCoding FranciscoLozCoding commented Apr 30, 2024

Summary

Updates to make api endpoint faster.

/api/v-beta/nodes/

Before updates:

% time curl http://127.0.0.1:8000/api/v-beta/nodes/ > /dev/null 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  157k  100  157k    0     0   216k      0 --:--:-- --:--:-- --:--:--  216k
0.01s user 0.01s system 2% cpu 0.752 total

After updates:

% time curl http://127.0.0.1:8000/api/v-beta/nodes/ > /dev/null 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  157k  100  157k    0     0  1370k      0 --:--:-- --:--:-- --:--:-- 1378k
0.01s user 0.01s system 10% cpu 0.131 total
  • After updates, sql queries went from 750 to 15.

/manifests/

Before updates:

% time curl http://127.0.0.1:8000/manifests/ > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1742k  100 1742k    0     0  1198k      0  0:00:01  0:00:01 --:--:-- 1198k
0.01s user 0.01s system 1% cpu 1.480 total

After updates:

% time curl http://127.0.0.1:8000/manifests/ > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1742k  100 1742k    0     0  7297k      0 --:--:-- --:--:-- --:--:-- 7323k
0.01s user 0.01s system 6% cpu 0.260 total
  • After updates, sql queries went from 249 to 24.

/computes/

Before updates:

% time curl http://127.0.0.1:8000/computes/ > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 40429  100 40429    0     0  21519      0  0:00:01  0:00:01 --:--:-- 21516
0.01s user 0.01s system 0% cpu 1.899 total

After updates:

% time curl http://127.0.0.1:8000/computes/ > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 40429  100 40429    0     0  1099k      0 --:--:-- --:--:-- --:--:-- 1128k
0.01s user 0.01s system 25% cpu 0.052 total
  • After updates, sql queries went from 851 to 5.

/sensors/

Before updates:

% time curl http://127.0.0.1:8000/sensors/ > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 32806  100 32806    0     0   219k      0 --:--:-- --:--:-- --:--:--  220k
0.01s user 0.01s system 9% cpu 0.173 total

After updates:

% time curl http://127.0.0.1:8000/sensors/ > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 32806  100 32806    0     0   498k      0 --:--:-- --:--:-- --:--:--  500k
0.01s user 0.01s system 16% cpu 0.081 total
  • After updates, sql queries went from 39 to 12.

/node-builds/

Before updates:

% time curl http://127.0.0.1:8000/node-builds/ > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 52502  100 52502    0     0   201k      0 --:--:-- --:--:-- --:--:--  202k
0.01s user 0.01s system 5% cpu 0.273 total

After updates:

% time curl http://127.0.0.1:8000/node-builds/ > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 52502  100 52502    0     0  1411k      0 --:--:-- --:--:-- --:--:-- 1424k
0.01s user 0.01s system 26% cpu 0.054 total
  • After updates, sql queries went from 223 to 8.

/lorawandevices/

Before updates:

% time curl http://127.0.0.1:8000/lorawandevices/ > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    58  100    58    0     0   1095      0 --:--:-- --:--:-- --:--:--  1115
0.01s user 0.01s system 18% cpu 0.070 total

After updates:

% time curl http://127.0.0.1:8000/lorawandevices/ > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    58  100    58    0     0   1317      0 --:--:-- --:--:-- --:--:--  1348
0.01s user 0.01s system 22% cpu 0.061 total
  • After updates, sql queries went from 9 to 7.

/lorawanconnections/

Before updates:

% time curl http://127.0.0.1:8000/lorawanconnections/ > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    58  100    58    0     0   1373      0 --:--:-- --:--:-- --:--:--  1380
0.01s user 0.01s system 23% cpu 0.061 total

After updates:

% time curl http://127.0.0.1:8000/lorawanconnections/ > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    58  100    58    0     0   4219      0 --:--:-- --:--:-- --:--:--  4461
0.01s user 0.01s system 42% cpu 0.030 total

/sensorhardwares/

Before updates:

% time curl http://127.0.0.1:8000/sensorhardwares/ > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    58  100    58    0     0   3175      0 --:--:-- --:--:-- --:--:--  3222
0.01s user 0.01s system 40% cpu 0.040 total

After updates:

% time curl http://127.0.0.1:8000/sensorhardwares/ > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    58  100    58    0     0   4213      0 --:--:-- --:--:-- --:--:--  4461
0.01s user 0.01s system 43% cpu 0.030 total
  • After updates, sql queries went from 31 to 6.

@FranciscoLozCoding FranciscoLozCoding marked this pull request as ready for review May 3, 2024 19:31
@seanshahkarami seanshahkarami merged commit 50f7d64 into main May 14, 2024
5 checks passed
@FranciscoLozCoding FranciscoLozCoding deleted the faster-node-endpoint branch May 22, 2024 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants