I've got a 4 core CPU + 256 GB RAM, and scrub on 2 pools is leaving almost no resources at all for user activity.  SSH and Web UI sessions cant connect, the shell prompt and console key presses take around 3~12 seconds to appear after keys are pressed, nice --5 doesnt seem to help. It's not RAM starvation as top says it's got 115GB  free.
Pausing scrub fixes it immediately, but I need scrub to be able to work in the background so it's not really a solution.
Top says its related to z_rd_int, and there are threads on Google saying that indeed this can max out CPU. But I can't find a thread that says, specifically, on FreeBSD, how to tune it back under control. The only relevant tunables I can find seem to be vdev.scrub_max_active (amount of simultaneous IO that scrub can issue, as z_rd_int sounds like scrub IO) and sync_taskq_batch_pct which controls max % of CPU the queue can use. They don't seem to be helping.
So I swapped the 4 core Xeon for an 8 core Xeon and immediately scrub now wants to consume 100% of 8 cores not 100% of 4 cores. Great win!
The server is totally idle otherwise - no local tasks, no client use, other than a console session and scrubbing.
Any suggestions as to which tunables might be encouraging this excessive resource use, or able to bring it under control, would be really helpful.
	
		
			
		
		
	
		
		
	
	
		 
	
	
		
			
		
		
	
(8 core / 16 thread Xeon)
Mostly free CPU is 0.0%, this is a rare time its nonzero at 0.4%
	
		
			
		
		
	
			
			Pausing scrub fixes it immediately, but I need scrub to be able to work in the background so it's not really a solution.
Top says its related to z_rd_int, and there are threads on Google saying that indeed this can max out CPU. But I can't find a thread that says, specifically, on FreeBSD, how to tune it back under control. The only relevant tunables I can find seem to be vdev.scrub_max_active (amount of simultaneous IO that scrub can issue, as z_rd_int sounds like scrub IO) and sync_taskq_batch_pct which controls max % of CPU the queue can use. They don't seem to be helping.
So I swapped the 4 core Xeon for an 8 core Xeon and immediately scrub now wants to consume 100% of 8 cores not 100% of 4 cores. Great win!
The server is totally idle otherwise - no local tasks, no client use, other than a console session and scrubbing.
Any suggestions as to which tunables might be encouraging this excessive resource use, or able to bring it under control, would be really helpful.
(8 core / 16 thread Xeon)
Mostly free CPU is 0.0%, this is a rare time its nonzero at 0.4%
			
				Last edited: 
			
		
	
								
								
									
	
		
			
		
		
	
	
		
			
		
	
	
		
			
		
		
	
								
							
							 
				 
 
		 
			
		
	
	
		 
						
					 
 
		 
 
		 
 
		