[GH-ISSUE #193] High CPU usage with S3FS #106

Closed
opened 2026-03-04 01:42:11 +03:00 by kerem · 2 comments
Owner

Originally created by @junaidnasir on GitHub (Jun 6, 2015).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/193

Hi,

I have mounted my S3 Bucket on Ubuntu 14.04 EC2 instance using s3fs V1.78. But I am facing high CPU usage by s3fs. I have tried to terminate all the programs that access the mounted S3 bucket but still the CPU usage by s3fs remain around 40-60%. If I run nload, it shows that around 4Mbps of each upload and download bandwidth is constantly being used by s3fs. Running tcpdump on the eth0 interface shows the following results:

11:01:45.449108 IP s3-us-west-2-r-w.amazonaws.com.http > ip-xx-xx-xx-xx.us-west-2.compute.internal.34960: Flags [F.], seq 467, ack 490, win 127, length 0
11:01:45.449115 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34960 > s3-us-west-2-r-w.amazonaws.com.http: Flags [.], ack 468, win 219, length 0
11:01:45.449121 IP s3-us-west-2-r-w.amazonaws.com.http > ip-xx-xx-xx-xx.us-west-2.compute.internal.34961: Flags [F.], seq 467, ack 490, win 127, length 0
11:01:45.449123 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34961 > s3-us-west-2-r-w.amazonaws.com.http: Flags [.], ack 468, win 219, length 0
11:01:45.449125 IP s3-us-west-2-r-w.amazonaws.com.http > ip-xx-xx-xx-xx.us-west-2.compute.internal.34963: Flags [F.], seq 467, ack 490, win 127, length 0
11:01:45.449127 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34963 > s3-us-west-2-r-w.amazonaws.com.http: Flags [.], ack 468, win 219, length 0
11:01:45.449129 IP s3-us-west-2-r-w.amazonaws.com.http > ip-xx-xx-xx-xx.us-west-2.compute.internal.34962: Flags [F.], seq 467, ack 490, win 127, length 0
11:01:45.449131 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34962 > s3-us-west-2-r-w.amazonaws.com.http: Flags [.], ack 468, win 219, length 0
11:01:45.449133 IP s3-us-west-2-r-w.amazonaws.com.http > ip-xx-xx-xx-xx.us-west-2.compute.internal.34965: Flags [F.], seq 467, ack 490, win 127, length 0
11:01:45.449135 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34965 > s3-us-west-2-r-w.amazonaws.com.http: Flags [.], ack 468, win 219, length 0
11:01:45.449136 IP s3-us-west-2-r-w.amazonaws.com.http > ip-xx-xx-xx-xx.us-west-2.compute.internal.34964: Flags [F.], seq 467, ack 490, win 127, length 0
11:01:45.449138 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34964 > s3-us-west-2-r-w.amazonaws.com.http: Flags [.], ack 468, win 219, length 0
11:01:45.449196 IP s3-us-west-2-r-w.amazonaws.com.http > ip-xx-xx-xx-xx.us-west-2.compute.internal.34966: Flags [F.], seq 467, ack 490, win 127, length 0
11:01:45.449201 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34966 > s3-us-west-2-r-w.amazonaws.com.http: Flags [.], ack 468, win 219, length 0
11:01:45.451246 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34967 > s3-us-west-2-r-w.amazonaws.com.http: Flags [S], seq 825593315, win 26883, options [mss 8961,sackOK,TS val 4676135 ecr 0,nop,wscale 7], length 0
11:01:45.451294 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34968 > s3-us-west-2-r-w.amazonaws.com.http: Flags [S], seq 4236543027, win 26883, options [mss 8961,sackOK,TS val 4676135 ecr 0,nop,wscale 7], length 0
11:01:45.451336 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34969 > s3-us-west-2-r-w.amazonaws.com.http: Flags [S], seq 2755147062, win 26883, options [mss 8961,sackOK,TS val 4676135 ecr 0,nop,wscale 7], length 0
11:01:45.451378 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34970 > s3-us-west-2-r-w.amazonaws.com.http: Flags [S], seq 3301106235, win 26883, options [mss 8961,sackOK,TS val 4676135 ecr 0,nop,wscale 7], length 0
11:01:45.451411 IP s3-us-west-2-r-w.amazonaws.com.http > ip-xx-xx-xx-xx.us-west-2.compute.internal.34967: Flags [S.], seq 4211935742, ack 825593316, win 8190, options [mss 1460,nop,wscale 6,nop,nop,sackOK], length 0
11:01:45.451419 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34967 > s3-us-west-2-r-w.amazonaws.com.http: Flags [.], ack 1, win 211, length 0
11:01:45.451439 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34971 > s3-us-west-2-r-w.amazonaws.com.http: Flags [S], seq 932063210, win 26883, options [mss 8961,sackOK,TS val 4676135 ecr 0,nop,wscale 7], length 0
11:01:45.451457 IP s3-us-west-2-r-w.amazonaws.com.http > ip-xx-xx-xx-xx.us-west-2.compute.internal.34968: Flags [S.], seq 2386815780, ack 4236543028, win 8190, options [mss 1460,nop,wscale 6,nop,nop,sackOK], length 0
11:01:45.451462 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34968 > s3-us-west-2-r-w.amazonaws.com.http: Flags [.], ack 1, win 211, length 0
11:01:45.451501 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34972 > s3-us-west-2-r-w.amazonaws.com.http: Flags [S], seq 1475287689, win 26883, options [mss 8961,sackOK,TS val 4676135 ecr 0,nop,wscale 7], length 0
11:01:45.451521 IP s3-us-west-2-r-w.amazonaws.com.http > ip-xx-xx-xx-xx.us-west-2.compute.internal.34969: Flags [S.], seq 2198043359, ack 2755147063, win 8190, options [mss 1460,nop,wscale 6,nop,nop,sackOK], length 0

Similarly running netstat -a gives multiple thousands of connections in TIME_WAIT state. A snippet of the output of netstat command is as follows:

tcp        0      0 ip-xx-xx-xx-xx.:52793 s3-us-west-2-r-w.a:http TIME_WAIT
tcp        0      0 ip-xx-xx-xx-xx.:50248 s3-us-west-2-r-w.a:http TIME_WAIT
tcp        0      0 ip-xx-xx-xx-xx.:51943 s3-us-west-2-r-w.a:http TIME_WAIT
tcp        0      0 ip-xx-xx-xx-xx.:60971 s3-us-west-2-r-w.a:http TIME_WAIT
tcp        0      0 ip-xx-xx-xx-xx.:60123 s3-us-west-2-r-w.a:http TIME_WAIT
tcp        0      0 ip-xx-xx-xx-xx.:52770 s3-us-west-2-r-w.a:http TIME_WAIT
tcp        0      0 ip-xx-xx-xx-xx.:46681 s3-us-west-2-r-w.a:http TIME_WAIT
tcp        0      0 ip-xx-xx-xx-xx.:43477 s3-us-west-2-r-w.a:http TIME_WAIT
tcp        0      0 ip-xx-xx-xx-xx.:60124 s3-us-west-2-r-w.a:http TIME_WAIT
tcp        0      0 ip-xx-xx-xx-xx.:47523 s3-us-west-2-r-w.a:http TIME_WAIT
tcp        0      0 ip-xx-xx-xx-xx.:51692 s3-us-west-2-r-w.a:http TIME_WAIT
tcp        0      0 ip-xx-xx-xx-xx.:52277 s3-us-west-2-r-w.a:http TIME_WAIT
tcp        0      0 ip-xx-xx-xx-xx.:58728 s3-us-west-2-r-w.a:http TIME_WAIT

Does anyone have any idea, how to resolve this issue?

Originally created by @junaidnasir on GitHub (Jun 6, 2015). Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/193 Hi, I have mounted my S3 Bucket on Ubuntu 14.04 EC2 instance using s3fs V1.78. But I am facing high CPU usage by s3fs. I have tried to terminate all the programs that access the mounted S3 bucket but still the CPU usage by s3fs remain around 40-60%. If I run nload, it shows that around 4Mbps of each upload and download bandwidth is constantly being used by s3fs. Running tcpdump on the eth0 interface shows the following results: ``` 11:01:45.449108 IP s3-us-west-2-r-w.amazonaws.com.http > ip-xx-xx-xx-xx.us-west-2.compute.internal.34960: Flags [F.], seq 467, ack 490, win 127, length 0 11:01:45.449115 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34960 > s3-us-west-2-r-w.amazonaws.com.http: Flags [.], ack 468, win 219, length 0 11:01:45.449121 IP s3-us-west-2-r-w.amazonaws.com.http > ip-xx-xx-xx-xx.us-west-2.compute.internal.34961: Flags [F.], seq 467, ack 490, win 127, length 0 11:01:45.449123 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34961 > s3-us-west-2-r-w.amazonaws.com.http: Flags [.], ack 468, win 219, length 0 11:01:45.449125 IP s3-us-west-2-r-w.amazonaws.com.http > ip-xx-xx-xx-xx.us-west-2.compute.internal.34963: Flags [F.], seq 467, ack 490, win 127, length 0 11:01:45.449127 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34963 > s3-us-west-2-r-w.amazonaws.com.http: Flags [.], ack 468, win 219, length 0 11:01:45.449129 IP s3-us-west-2-r-w.amazonaws.com.http > ip-xx-xx-xx-xx.us-west-2.compute.internal.34962: Flags [F.], seq 467, ack 490, win 127, length 0 11:01:45.449131 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34962 > s3-us-west-2-r-w.amazonaws.com.http: Flags [.], ack 468, win 219, length 0 11:01:45.449133 IP s3-us-west-2-r-w.amazonaws.com.http > ip-xx-xx-xx-xx.us-west-2.compute.internal.34965: Flags [F.], seq 467, ack 490, win 127, length 0 11:01:45.449135 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34965 > s3-us-west-2-r-w.amazonaws.com.http: Flags [.], ack 468, win 219, length 0 11:01:45.449136 IP s3-us-west-2-r-w.amazonaws.com.http > ip-xx-xx-xx-xx.us-west-2.compute.internal.34964: Flags [F.], seq 467, ack 490, win 127, length 0 11:01:45.449138 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34964 > s3-us-west-2-r-w.amazonaws.com.http: Flags [.], ack 468, win 219, length 0 11:01:45.449196 IP s3-us-west-2-r-w.amazonaws.com.http > ip-xx-xx-xx-xx.us-west-2.compute.internal.34966: Flags [F.], seq 467, ack 490, win 127, length 0 11:01:45.449201 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34966 > s3-us-west-2-r-w.amazonaws.com.http: Flags [.], ack 468, win 219, length 0 11:01:45.451246 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34967 > s3-us-west-2-r-w.amazonaws.com.http: Flags [S], seq 825593315, win 26883, options [mss 8961,sackOK,TS val 4676135 ecr 0,nop,wscale 7], length 0 11:01:45.451294 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34968 > s3-us-west-2-r-w.amazonaws.com.http: Flags [S], seq 4236543027, win 26883, options [mss 8961,sackOK,TS val 4676135 ecr 0,nop,wscale 7], length 0 11:01:45.451336 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34969 > s3-us-west-2-r-w.amazonaws.com.http: Flags [S], seq 2755147062, win 26883, options [mss 8961,sackOK,TS val 4676135 ecr 0,nop,wscale 7], length 0 11:01:45.451378 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34970 > s3-us-west-2-r-w.amazonaws.com.http: Flags [S], seq 3301106235, win 26883, options [mss 8961,sackOK,TS val 4676135 ecr 0,nop,wscale 7], length 0 11:01:45.451411 IP s3-us-west-2-r-w.amazonaws.com.http > ip-xx-xx-xx-xx.us-west-2.compute.internal.34967: Flags [S.], seq 4211935742, ack 825593316, win 8190, options [mss 1460,nop,wscale 6,nop,nop,sackOK], length 0 11:01:45.451419 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34967 > s3-us-west-2-r-w.amazonaws.com.http: Flags [.], ack 1, win 211, length 0 11:01:45.451439 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34971 > s3-us-west-2-r-w.amazonaws.com.http: Flags [S], seq 932063210, win 26883, options [mss 8961,sackOK,TS val 4676135 ecr 0,nop,wscale 7], length 0 11:01:45.451457 IP s3-us-west-2-r-w.amazonaws.com.http > ip-xx-xx-xx-xx.us-west-2.compute.internal.34968: Flags [S.], seq 2386815780, ack 4236543028, win 8190, options [mss 1460,nop,wscale 6,nop,nop,sackOK], length 0 11:01:45.451462 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34968 > s3-us-west-2-r-w.amazonaws.com.http: Flags [.], ack 1, win 211, length 0 11:01:45.451501 IP ip-xx-xx-xx-xx.us-west-2.compute.internal.34972 > s3-us-west-2-r-w.amazonaws.com.http: Flags [S], seq 1475287689, win 26883, options [mss 8961,sackOK,TS val 4676135 ecr 0,nop,wscale 7], length 0 11:01:45.451521 IP s3-us-west-2-r-w.amazonaws.com.http > ip-xx-xx-xx-xx.us-west-2.compute.internal.34969: Flags [S.], seq 2198043359, ack 2755147063, win 8190, options [mss 1460,nop,wscale 6,nop,nop,sackOK], length 0 ``` Similarly running netstat -a gives multiple thousands of connections in TIME_WAIT state. A snippet of the output of netstat command is as follows: ``` tcp 0 0 ip-xx-xx-xx-xx.:52793 s3-us-west-2-r-w.a:http TIME_WAIT tcp 0 0 ip-xx-xx-xx-xx.:50248 s3-us-west-2-r-w.a:http TIME_WAIT tcp 0 0 ip-xx-xx-xx-xx.:51943 s3-us-west-2-r-w.a:http TIME_WAIT tcp 0 0 ip-xx-xx-xx-xx.:60971 s3-us-west-2-r-w.a:http TIME_WAIT tcp 0 0 ip-xx-xx-xx-xx.:60123 s3-us-west-2-r-w.a:http TIME_WAIT tcp 0 0 ip-xx-xx-xx-xx.:52770 s3-us-west-2-r-w.a:http TIME_WAIT tcp 0 0 ip-xx-xx-xx-xx.:46681 s3-us-west-2-r-w.a:http TIME_WAIT tcp 0 0 ip-xx-xx-xx-xx.:43477 s3-us-west-2-r-w.a:http TIME_WAIT tcp 0 0 ip-xx-xx-xx-xx.:60124 s3-us-west-2-r-w.a:http TIME_WAIT tcp 0 0 ip-xx-xx-xx-xx.:47523 s3-us-west-2-r-w.a:http TIME_WAIT tcp 0 0 ip-xx-xx-xx-xx.:51692 s3-us-west-2-r-w.a:http TIME_WAIT tcp 0 0 ip-xx-xx-xx-xx.:52277 s3-us-west-2-r-w.a:http TIME_WAIT tcp 0 0 ip-xx-xx-xx-xx.:58728 s3-us-west-2-r-w.a:http TIME_WAIT ``` Does anyone have any idea, how to resolve this issue?
kerem closed this issue 2026-03-04 01:42:11 +03:00
Author
Owner

@gaul commented on GitHub (Jun 6, 2015):

Perhaps updatedb is indexing your s3fs mountpoint? Try running lsof or mounting s3fs with the -f parameter.

<!-- gh-comment-id:109617253 --> @gaul commented on GitHub (Jun 6, 2015): Perhaps `updatedb` is indexing your s3fs mountpoint? Try running `lsof` or mounting s3fs with the `-f` parameter.
Author
Owner

@junaidnasir commented on GitHub (Jun 8, 2015):

@andrewgaul That was it, thank you very much. added mount point to updatedb's ignore list.

<!-- gh-comment-id:109952872 --> @junaidnasir commented on GitHub (Jun 8, 2015): @andrewgaul That was it, thank you very much. added mount point to `updatedb`'s ignore list.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#106
No description provided.