Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compression fails when using ionic zip

Tags:

c#

zip

dotnetzip

I am using the latest version of ionic zip version 1.9.1.8.I have set the property of ionic zip ParallelDeflateThreshold = 0. The zipping mechanism was working perfectly for the past two months.Suddenly this stopped working.The zipping thread just hangs,ionic zip just created the tmp file and failed to create the zip file. I could easily reproduce this issue even with small file size.

My analysis for this issue is as follows

The issue was with the latest version of ionic zip, in this case the ionic zip hanged while creating the zip files. We noticed that, a couple of other users who uses this dll has also reported such errors in their site. Please refer the link.This issue will be solved by disabling ParallelThreshold property of ionic zip, but it will delay the performance for large log files, since it works on single thread instead of multithreaded mode.

The issue was solved now by setting ParallelDeflateThreshold property to default value.But I couldn't find the exact cause of this issue.Why does the zipping fail suddenly? There was no machine change.

like image 586
Techy Avatar asked Aug 16 '12 05:08

Techy


1 Answers

I was facing a similar issue, with smaller zip files less than 20-25MB, it was taking 3-4 seconds, but anything larger than that, it was taking infinite time. Code never finished execution.

I started to worry that maybe it was the wrong decision to use DotNetZip library afterall, as we work with zipfiles upto 500MB.

Before the line where zip file is saved, I added: zip.ParallelDeflateThreshold = -1;

This makes sure that separate threads are never created. Looks like once the zip files goes past a certain threshold, DotNetZip keeps creating numerous threads causing a very large latency in obtaining the final zip file.

like image 193
Kimi Avatar answered Oct 20 '22 19:10

Kimi