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

Sometimes filter does not send the final piece #81

Closed
eustas opened this issue Sep 3, 2019 · 12 comments
Closed

Sometimes filter does not send the final piece #81

eustas opened this issue Sep 3, 2019 · 12 comments

Comments

@eustas
Copy link
Collaborator

eustas commented Sep 3, 2019

See eustas#37

@dkrutsko
Copy link

dkrutsko commented Sep 5, 2019

Okay, so I ran several more tests and determined that it has nothing to do with nginx-module-vts but instead, the Brotli compression itself. Disabling Brotli in Nginx or requesting an uncompressed version of the page works properly. It turns out that the download is being truncated. I tested with all available compression levels and found that some result in truncation while others don't. Below is a list of compression levels and the amount of bytes they returned:

brotli_comp_level 1: ALL
brotli_comp_level 2: 114667
brotli_comp_level 3: 114667
brotli_comp_level 4: ALL
brotli_comp_level 5: 49152
brotli_comp_level 6: 49152
brotli_comp_level 7: 49152
brotli_comp_level 8: 49152
brotli_comp_level 9: ALL

Used with the following Brotli settings to request a 128978 byte HTML file

brotli on;
brotli_buffers 32 4k;
brotli_comp_level 6;
brotli_window 512k;
brotli_min_length 8192;
brotli_types application/javascript application/json application/vnd.ms-fontobject application/x-font-opentype application/x-font-truetype application/x-font-ttf application/x-javascript application/xml application/xml+rss font/eot font/opentype font/otf image/svg+xml image/vnd.microsoft.icon image/x-icon text/css text/javascript text/plain text/xml;

Requested using this cURL command: curl ${URL} -H 'accept-encoding: br' --compressed.

As this turns out to be a completly different issue from what it was before, perhaps the title needs to be changed or a new issue opened. But I'm not sure if this is a problem with Brotli itself or just the Nginx module.

@HansVanEijsden
Copy link

Oh, thanks so much. Perhaps this explains why I had incomplete javascript and css downloads sometimes (using compression level 6). I'll try level 4 when the 100% CPU bug has been fixed too.

@eustas
Copy link
Collaborator Author

eustas commented Sep 6, 2019

Finally, managed to reproduce (on truncated war-and-piece with compression level 2) -> soon will be able to diagnose and fix =)

@eustas
Copy link
Collaborator Author

eustas commented Sep 6, 2019

#83 should fix the problem.
Currently have no test for it, though.

Could you, check if it helps in your situation?

Best regards,
Eugene.

@dkrutsko
Copy link

dkrutsko commented Sep 6, 2019

Okay, I can confirm that my use case has been fixed across all compression levels. @HansVanEijsden would you be able to verify if this fixes your asset issue?

@HansVanEijsden
Copy link

@dkrutsko I will try, but I cannot keep it running in production because of #80 - the next 24 hours I will be away or sleeping so I cannot monitor the production instance in case of the 100% CPU problem. Let's see how it goes for the next 2 hours. I will report back my findings here.

@HansVanEijsden
Copy link

@dkrutsko the problem seems to be solved, no more truncation here at compression level 6 as far as I could see.
I had to disable ngx_brotli again unfortunately, because of the bug #80 - CPU usage went to 400% (4 cores) within 10 minutes of time and Nginx was hanging.

@dkrutsko
Copy link

dkrutsko commented Sep 7, 2019

@HansVanEijsden Do you know if this only happens with level 6? or level 6 and up? Is there one you recommend running in production for the time being?

@HansVanEijsden
Copy link

@dkrutsko I don't know yet. Currently I'm on the road but I am home in about 24 hours. I will experiment with it as soon as I'm home in a stable online situation. I'll let you know here!

@eustas
Copy link
Collaborator Author

eustas commented Sep 7, 2019

Just landed #83.

@dkrutsko
Copy link

dkrutsko commented Sep 9, 2019

@eustas Thanks a lot for this! Are there any plans to do GitHub releases for these or do you advise just cloning master in production?

@eustas
Copy link
Collaborator Author

eustas commented Sep 9, 2019

Going to release soon, after fixing a little bit more. Hopefully this week.

@eustas eustas changed the title Conflict with nginx-module-vts Sometimes filter does not send the final piece Sep 10, 2019
@eustas eustas closed this as completed Sep 10, 2019
@awused awused mentioned this issue Mar 4, 2020
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