大网数据广告活动
服务器运维问答

7Zip extraction on linux is so slow

· 52CE 我爱测

Extracting 7zip with many small files on linux xfs, extraction speed is so slow. My Test System Environment. System1 : 2vCore/4GB CentOS 6.5 64bit guest on XenServer. System2 : 2vCore/4GB Windows 2012 guest on XenServer. Large sm…

问题原文

原帖链接 · fromcloud · CC BY-SA 3.0

Extracting 7zip with many small files on linux xfs, extraction speed is so slow.

My Test System Environment.

  • System1 : 2vCore/4GB CentOS 6.5 64bit guest on XenServer.
  • System2 : 2vCore/4GB Windows 2012 guest on XenServer.

Large small files Creation Script

#!/bin/bash

for i in {1..100000}
do
    dd if=/dev/zero of=./dmp/dd$i.dmp bs=1K count=4
done

ok. I got 4KB files of 100,000 in dmp directory. and then I formatted /testfs with xfs.

Test

Compression Time on System1 :
   # time 7za a dmp.7z ./dmp     --> real   0m27.518s
Extraction Time on System1: 
   # time 7za x dmp.7z -o/testfs --> real   9m5.420s
   - 7za use only single core.
   - Dirent system call use most of the CPU time.
Extraction Time on System2:
   - around 25s
   - 7za use multi-core.

My Question

  1. Although system2 use multi-core and system1 use single-core, such a big different result is unreliable. I think. How can I explain this ?

  2. If I use xfs on linux for extracting 7zip file, How can I speed up ? any idea ?

Thanks in advance.

社区高分解答

原帖链接 · bfontaine · CC BY-SA 4.0

I had the same issue, and the fix was to upgrade 7z. On Ubuntu 20.04 LTS, the 7z you get from apt install is from 2016. Instead, go download the latest version from the official website.

For the same archive with 60k small files on the same server, I went from 8 minutes to 6 seconds(!).

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2015-07-14)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。