Closed thereis closed 8 months ago
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);
},
});
The CPU will be high when start to launch Google, after that it's fine for me.
@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
@momokang, do you still working wiht the new library? does it good?
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.
I've built as a docker image and it's running on a VM with Docker.