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

Verify scaling target requirements #11

Open
richard-ramos opened this issue Feb 6, 2023 · 3 comments
Open

Verify scaling target requirements #11

richard-ramos opened this issue Feb 6, 2023 · 3 comments

Comments

@richard-ramos
Copy link
Member

richard-ramos commented Feb 6, 2023

waku-org/pm#12
Understand the expected:

  • rate of chat messages
  • rate of control messages
  • rate of store queries
  • avg expected bandwidth usage of each of the above

cc: @Menduist, @jm-clius

@richard-ramos
Copy link
Member Author

The tables receivedMessages, receivedMessageAggregate, protocolStatsRate and protocolStatsTotal (which can be accesed via https://superset.infra.status.im/superset/sqllab/) and Grafana can be used to obtain the above data

Useful queries (possible to do after version 0.10.0 is released)

Number of chat messages per day

SELECT date_trunc('day', to_timestamp(createdAt)) "day", count(*) as num_messages
FROM receivedMessages
WHERE messageType IN ('CHAT_MESSAGE', 'EMOJI_REACTION', 'EDIT_MESSAGE', 'DELETE_MESSAGE')
-- USE `NOT IN` to obtain control messages
GROUP BY 1

Average number and byte size of messages per user per day

SELECT day, avg(num_msgs) avg_num_msg_per_user, avg(avg_message_size_bytes) avg_msg_size_bytes FROM (
  SELECT date_trunc('day', to_timestamp(createdAt)) "day", receiverkeyuid, count(*) num_msgs, avg(messagesize) avg_message_size_bytes
  FROM receivedMessages
  WHERE messageType IN ('CHAT_MESSAGE', 'EMOJI_REACTION', 'EDIT_MESSAGE', 'DELETE_MESSAGE')
  -- USE `NOT IN` to obtain control messages
  GROUP BY 1, receiverkeyuid 
) q
GROUP BY day

Avg total bandwidth used by a protocol by an user session per day

SELECT createdAt, protocolname, avg(sumTi), avg(sumOut)
FROM (
  SELECT createdAt, peerId, protocolname, sum(totalin) sumTi, sum(totalout) sumOut FROM protocolstatstotals 
  GROUP BY peerId, protocolName, createdAt
) q
GROUP BY createdAt, protocolName

@rymnc
Copy link
Member

rymnc commented Mar 2, 2023

adding a query to this thread -

average size of a "BACKUP" msg sent by a user

SELECT chatid, AVG(messagesize)
FROM receivedmessages
WHERE messagetype = 'BACKUP' AND messagesize > 0
GROUP BY chatid
ORDER BY AVG(messagesize) DESC 
LIMIT 25;

@fryorcraken
Copy link

Is there much that can be done before dogfooding? What are the next expected steps?

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

No branches or pull requests

3 participants