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

Use memory instead of temp files for (fake) packets, please #102

Open
EvgenKo423 opened this issue Aug 24, 2024 · 3 comments
Open

Use memory instead of temp files for (fake) packets, please #102

EvgenKo423 opened this issue Aug 24, 2024 · 3 comments

Comments

@EvgenKo423
Copy link

Don't use the temp files for packets, please, it's bad for performance.
On Windows temp files are just files and not mapped to memory as on Linux. It should be possible to use memory buffers instead, as you do with --split.


Пожалуйста не используйте временные файлы для пакетов, это очень не оптимально.
В Windows временные файлы – просто файлы и не маппятся на память как в Linux. Это должно быть возможно реализовать с использованием буферов в памяти, как вы делаете со --split.

@hufrea
Copy link
Owner

hufrea commented Aug 24, 2024

Cache bevavior

Specifying the FILE_ATTRIBUTE_TEMPORARY attribute causes file systems to avoid writing data back to mass storage if sufficient cache memory is available, because an application deletes a temporary file after a handle is closed. In that case, the system can entirely avoid writing the data.

как вы делаете со --split

Обычный send скопирует буфер в пространство ядра (а значит их уже не изменить, отправку отменить нельзя), в таком случае ОС гарантированно доставит фейк, а это сломает протокол. Тут я объяснял как это работает.

@ropucyka
Copy link

Можно добавить возможность указать путь для временных файлов, чтобы ByeDPI работала с ними на RAM диске например. [здесь смайлик клоуна] но похоже на хорошую идею.

@EvgenKo423
Copy link
Author

EvgenKo423 commented Aug 25, 2024

@hufrea Крутяк, спасибо за пояснения.
Про --split и --disorder я читал у bol-van'а, на уровне прокси это конечно дикие костыли...

В документации по TransmitFile ещё говорится:

Workstation and client versions of Windows optimize the TransmitFile function for minimum memory and resource utilization by limiting the number of concurrent TransmitFile operations allowed on the system to a maximum of two. On Windows Vista, Windows XP, Windows 2000 Professional, and Windows NT Workstation 3.51 and later only two outstanding TransmitFile requests are handled simultaneously; the third request will wait until one of the previous requests is completed.

Так что у любителей открывать несколько вкладок в фоне она может блокироваться.

@ropucyka Не работал с RAM-дисками, но можно наверно просто слинковать на него Temp на уровне файловой системы. ;-)

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