Closed imnobody221 closed 1 year ago
My current solution for now is wait until new thread success launch bas browser and then open a new thread worker. this step 'work but took long time to open example 10 browser. this bcs need to wait one by one thread to complete open new bas browser before open another thread worker. is there any solution to open 10 thread/browser simultaneously?
Hey @imnobody221,
We currently lack parallel tests or documentation demonstrating how to avoid such errors with the recommended logic from maintainers.
On a related note, I've raised an issue in one of the upstream library. Here's the link: https://github.com/CheshireCaat/browser-with-fingerprints/issues/2.
I also wanted to share a recommendation with you that might be helpful. It's recommended that each script/thread/process runs with a different FINGERPRINT_CWD
folder to prevent functionality issues that may arise when multiple copies of the script update or use Browser dependencies simultaneously.
Here are some steps you can follow to implement this recommendation:
FINGERPRINT_CWD
to a custom pathFINGERPRINT_CWD
folder to a new pathFINGERPRINT_CWD
to the new path.FINGERPRINT_CWD
variable.Additionally, I believe that setting up a new clean environment for each thread/process can be a good solution to prevent Browser dependency issues. I have been using such logic for many years in different situations because I prefer to run all of my tests in parallel, and I need to prepare a separate environment for each test. This is especially helpful if you are using any CI/CD scripts.
However, in any case, an official recommendation from the code owner would be beneficial.
Let me know if you have any further questions or if there's anything else I can help you with.
Thanks!
Support for worker threads is missing and was not originally intended. Currently, synchronization is safely implemented only within a single process.
For now, the best solution is to specify a separate FINGERPRINT_CWD
for each worker, as @sergerdn pointed out above.
@sergerdn, the problem with such detailed documentation on the internal structure of the library is that it's needed by the smallest possible number of people, and it takes a lot of time to implement it. Nobody says that it is useless, but now it's not a priority.
The rest of the users are interested in using, not customizing.
What to talk about, even if a bunch of references to the supported OS
in the documentation are constantly ignored.
This is just my vision, I'm not ready to debate right now.
Support for worker threads is missing and was not originally intended. Currently, synchronization is safely implemented only within a single process.
For now, the best solution is to specify a separate
FINGERPRINT_CWD
for each worker, as @sergerdn pointed out above.
Would you be interested in adding some information about this to the documentation? I believe that such situations may arise in the future and having this information available in the documentation would be beneficial.
Yes, i'll add it later.
The rest of the users are interested in using, not customizing. What to talk about, even if a bunch of references to the supported
OS
in the documentation are constantly ignored.
I think this situation arose because it was unexpected for developers to encounter a script that exclusively supports the Windows
platform, especially for those who are not very familiar with BAS
. In light of this, I suggest modifying the README.md
file to make it crystal clear that puppeteer-with-fingerprints
only supports Windows
at the moment.
We can achieve this by changing the note on the first line of the README.md
file to something like this:
puppeteer-with-fingerprints
(ONLY WINDOWS CURRENTLY SUPPORTED!). :smile:
Hey @imnobody221,
We currently lack parallel tests or documentation demonstrating how to avoid such errors with the recommended logic from maintainers.
On a related note, I've raised an issue in one of the upstream library. Here's the link: CheshireCaat/browser-with-fingerprints#2.
I also wanted to share a recommendation with you that might be helpful. It's recommended that each script/thread/process runs with a different
FINGERPRINT_CWD
folder to prevent functionality issues that may arise when multiple copies of the script update or use Browser dependencies simultaneously.Here are some steps you can follow to implement this recommendation:
- Set
FINGERPRINT_CWD
to a custom path- Run a simple script to download all dependencies/artefacts to that folder and then stop it
- Copy the
FINGERPRINT_CWD
folder to a new path- Before running any new script/thread/process, set
FINGERPRINT_CWD
to the new path.- Repeat steps 3-4 if necessary.
- Run all thread/script/worker/etc at once to open multiple browsers simultaneously each with their
FINGERPRINT_CWD
variable.Additionally, I believe that setting up a new clean environment for each thread/process can be a good solution to prevent Browser dependency issues. I have been using such logic for many years in different situations because I prefer to run all of my tests in parallel, and I need to prepare a separate environment for each test. This is especially helpful if you are using any CI/CD scripts.
However, in any case, an official recommendation from the code owner would be beneficial.
Let me know if you have any further questions or if there's anything else I can help you with.
Thanks!
@sergerdn thank you for your suggestion. I tried and it work wonderful. but honestly it not really effective to open/create 10 or even 100 engine separately. overtime size or engine alone took a lot of space, not to mention the profile folder size. Even though we can used 10 engine to run 100 browser Parallelly while synchronized between calls to reduce CPU spiking, still it better than nothing.
Support for worker threads is missing and was not originally intended. Currently, synchronization is safely implemented only within a single process.
For now, the best solution is to specify a separate
FINGERPRINT_CWD
for each worker, as @sergerdn pointed out above.
@CheshireCaat Thank you for you reply regarding this multithread issue. I really appreciate what you and you team doing here. It took a lot of afford to create this plugin that able to mask fingerprint. Not many company/developer create this framework for free. By providing detail documentation really help us a lot, but I do understand you guys need more time to improve BAS. Hope in future a lot improvement can be done. Thank you again!
@imnobody221
By providing detail documentation really help us a lot, but I do understand you guys need more time to improve or fix anonymity of the bas.
What exactly need to be fixed?
@sergerdn thank you for your suggestion. I tried and it work wonderful. but honestly it not really effective to open/create 10 or even 100 engine separately. overtime size or engine alone took a lot of space, not to mention the profile folder size. Even though we can used 10 engine to run 100 browser Parallelly while synchronized between calls to reduce CPU spiking, still it better than nothing.
I also suggest this logic:
Make sure that your machine has enough free RAM to support the RAM disk. Additionally, if you do not need your profile folder in the future, I recommend running your browser with a profile created on a RAM disk. This will significantly speed up the starting time and improve performance.
To improve your system's performance with a RAM disk, you can refer to this list of RAM drive software on Wikipedia: https://en.wikipedia.org/wiki/List_of_RAM_drive_software.
Note: If you are running your browser with a profile created on a RAM disk, you may need to write your own script to clear old profiles from memory periodically to prevent the RAM disk from filling up.
@imnobody221
By providing detail documentation really help us a lot, but I do understand you guys need more time to improve or fix anonymity of the bas.
What exactly need to be fixed?
read this this page: https://github.com/CheshireCaat/browser-with-fingerprints/issues/2 let me clarify again, you and your team need more time to do more important things. @bablosoft thank you for you and your team hard work. Really do like BAS.
read this this page: https://github.com/CheshireCaat/browser-with-fingerprints/issues/2
I've read this, and already answered in this topic, but I can't find where it contains report about anonimity issues.
Previously you wrote:
I do understand you guys need more time to improve or fix anonymity of the bas.
Can you specify, what exactly need to be fixed?
@bablosoft
Would you like to organise a GitHub discussion for the project to address this issue and move it forward for further consideration? Additionally, having discussions can also be beneficial for us in the future. I suggest that we share any useful tips and tricks during the discussion, and that we use tags to categorise our comments.
What do you think about it?
@bablosoft. English is not my first language, so please excuse any mistakes. Nothing need to be fixed, that just my assumption when you reply to @sergerdn "There are much more important things to do.". Done edit my comment above.
@sergerdn thank you for your suggestion. I tried and it work wonderful. but honestly it not really effective to open/create 10 or even 100 engine separately. overtime size or engine alone took a lot of space, not to mention the profile folder size. Even though we can used 10 engine to run 100 browser Parallelly while synchronized between calls to reduce CPU spiking, still it better than nothing.
I also suggest this logic:
- Gather the necessary files or artifacts.
- Transfer them to a storage location on a RAM disk that you have set up.
- For each script, create a separate environment by copying the required files from the RAM disk to the RAM disk.
- Launch the new process using the copied files in the separate environment.
Make sure that your machine has enough free RAM to support the RAM disk. Additionally, if you do not need your profile folder in the future, I recommend running your browser with a profile created on a RAM disk. This will significantly speed up the starting time and improve performance.
To improve your system's performance with a RAM disk, you can refer to this list of RAM drive software on Wikipedia: https://en.wikipedia.org/wiki/List_of_RAM_drive_software.
Note: If you are running your browser with a profile created on a RAM disk, you may need to write your own script to clear old profiles from memory periodically to prevent the RAM disk from filling up.
really like this idea. I will try to implement ASAP!. Thanks @sergerdn
@bablosoft. English is not my first language, so please excuse any mistakes. Nothing need to be fixed, that just my assumption when you reply to @sergerdn "There are much more important things to do.". Done edit my comment above.
I think that none of the people involved in this chat have English as their primary language. So, can we consider this matter resolved?
If you have any questions, please don't hesitate to open a new issue, and we will assist you as best we can.
okey, thank you @sergerdn @CheshireCaat @bablosoft for this help. Really appreciate.
try to run 2 thread worker using same puppeteer script but one of browser show output error : 1) "Error: Lock is not acquired/owned by you" 2) "Unable to start engine process (code: 3221225477)"
bellow is example code to produce this error. example.js :
code to run new thread worker: thread.js:
Error log produce: After first thread run. i believe this error code for 2 thread worker
sometime this error occur:
already try to delete and install new bas engine data. but error still occur for second thread. the first thread success without error