Giter Club home page Giter Club logo

Comments (8)

azickri avatar azickri commented on May 25, 2024

It depends on the specifications for running this package, because this package uses puppeteer as its main model, of course it's like running a browser on your computer.

from whatsapp-web.js.

momokang avatar momokang commented on May 25, 2024

@azickri I have few whatsapps running, only 1 of the customer has this issue, others are fine, it depends on how heavy load of the WhatsApp, not about browser only

from whatsapp-web.js.

azickri avatar azickri commented on May 25, 2024

@momokang Really? What specifications do you use to run this package?

from whatsapp-web.js.

momokang avatar momokang commented on May 25, 2024

@azickri 4v CPU with 8GB RAM, each time the customer trying to do like getChats, it needed to wait 30 seconds, for getMessages, maybe 10+ seconds, if I'm using my WhatsApp, it took within 1 second to get the data.

from whatsapp-web.js.

azickri avatar azickri commented on May 25, 2024

@momokang With these specifications, how many numbers are connected?

I think as for the slowness of retrieving messages, have you tried limiting it per request? You know, like pagination

from whatsapp-web.js.

momokang avatar momokang commented on May 25, 2024

@azickri Hello, sorry for not saying all the information, the server is connected with 4 numbers.

Yes, I do limit in getMessages

chat.fetchMessages({ limit: 20, })

but there is not pagination inside getChats so I just do my own getChats pagination

waClient.getChats()
.then(async function (chatsWithMessages) {
let output = [];
for (let key = 0; key < 50; key++) {
// return output

The CPU and Memory is not much, average is like 50%

image

from whatsapp-web.js.

azickri avatar azickri commented on May 25, 2024

Maybe the method for getting the message needs to be changed.

Previously I also directly fetched a message to the client and several users experienced this (it took a long time to get the message).

I changed the method to: every incoming message is saved to the Database, and for old messages there is a feature to Sync Messages in the Application, so users won't wait long to get messages.

This will also have a huge impact on the workflow of the applications we create and the extra work to change them.

Sorry if it doesn't help.

from whatsapp-web.js.

momokang avatar momokang commented on May 25, 2024

@azickri Yes, that is what I am planning to work on it on my next tasks, initially I told my customer I will not save their messages in my database (privacy concern), but now performance issue is impact on their daily works now... If the library can fetch messages and chats in fast speed, I'm planning not to work on this.. looks like this library can't help :(

Anyway, thanks for your reply and idea given, appreciated.

from whatsapp-web.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.