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

Performance issues #2051

Closed
thereis opened this issue Jan 31, 2024 · 4 comments
Closed

Performance issues #2051

thereis opened this issue Jan 31, 2024 · 4 comments
Labels
needs triage question Further information is requested

Comments

@thereis
Copy link

thereis commented Jan 31, 2024

Is there any tips to improve the performance of the client? It looks for me that uses a lot of resources such as CPU rather than memory. I think that's because of puppeteer but the amount of used resources is incredibly high!

It's a 24gb RAM VM with 8 vCPUS.

image

image

I've built as a docker image and it's running on a VM with Docker.

@thereis thereis added needs triage question Further information is requested labels Jan 31, 2024
@thereis
Copy link
Author

thereis commented Jan 31, 2024

This is my launch option:

this.client = await create({
      session: 'client',
      autoClose: 0,
      waitForLogin: true,
      headless: true,
      statusFind: (statusSession, session) => {
        console.log({ statusSession, session });
      },
      puppeteerOptions: {
        headless: true,
        userDataDir: process.env.USER_DATA_DIR || './.session-data',
        args: [
          '--no-sandbox',
          '--disable-setuid-sandbox',
          '--disable-dev-shm-usage',
          '--disable-accelerated-2d-canvas',
          '--disable-canvas-aa',
          '--disable-gl-drawing-for-tests',
          '--use-gl=desktop',
          '--no-first-run',
          '--no-zygote',
          '--single-process', // <- this one doesn't works in Windows
          '--disable-gpu',
        ],
      },
      disableWelcome: true,
      logQR: false,
      // it will send the qrcode image to discord for the user to login.
      catchQR: (qrCode: string) => {
        this.emit('wppService.onQRCode', qrCode);
      },
    });

@momokang
Copy link

The CPU will be high when start to launch Google, after that it's fine for me.

@thereis
Copy link
Author

thereis commented Feb 13, 2024

@momokang I've solved the problem using another library than this one. I had a lot of problems with high usage of CPU in larger groups. If you want keep optimal and a low budget for the project, use WhiskeySockets/Baileys

@thereis thereis closed this as completed Feb 15, 2024
@thereis thereis closed this as not planned Won't fix, can't repro, duplicate, stale Feb 15, 2024
@roysG
Copy link

roysG commented Mar 8, 2024

@momokang, do you still working wiht the new library? does it good?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants