<div dir="ltr">Thank you for the fast reply!<div><br></div><div>read_ops and write_ops is AWS EBS metric and in general it correlates with OS-level reads/s writes/s stats which iostat shows.<br></div><div><br></div><div>So if I understand you correctly max-swap-rate doesn't limit disk IOPS but limits squid swap ops instead and every squid operation could in theory use more than 1 disk IO operation. This means we can't really say "limit swap ops to 1500 because our disk can handle 1500 iops" but should figure out the number after testing different values.</div><div><br></div><div>Ok, I suppose I'll just do what Rock documentation says – will test different values and figure out what works for us.</div><div><br></div><div>Thanks again.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 18, 2018 at 2:54 PM, Alex Rousskov <span dir="ltr"><<a href="mailto:rousskov@measurement-factory.com" target="_blank">rousskov@measurement-factory.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 01/18/2018 03:16 PM, Ivan Larionov wrote:<br>
<br>
> cache_dir max-swap-rate documentation says that swap in requests<br>
> contribute to measured swap rate. However in our squid 4 load test we<br>
> see that read_ops + write_ops significantly exceeds the max-swap-rate we<br>
> set and squid doesn't limit it.<br>
<br>
</span>In this context, a single Squid "op" is a read or write request from<br>
worker to the disker process. These requests are up to one I/O page in<br>
size. A single I/O page is 32*1024 bytes. See Ipc::Mem::PageSize().<br>
<br>
* A single read request usually ends up being a single pread(2) system<br>
call that reads at most one I/O page worth of data from disk. See<br>
diskerRead().<br>
<br>
* A single write request usually ends up being a single pwrite(2) system<br>
call that writes at most one I/O page worth of data to disk. However, if<br>
that single pwrite() does not write everything a worker has requested to<br>
write, then Squid will make more pwrite() calls, up to 10 calls total.<br>
See diskerWrite().<br>
<br>
Within a single cache miss transaction, the rock code should accumulate<br>
small swapout requests from Store into page-size write requests to<br>
disker, but I do not remember how complete those optimizations are: It<br>
is possible that smaller-than-page writes get through to diskers,<br>
increasing the number of write requests. Same for reading cache hits.<br>
<br>
<br>
What is the "op" in read_ops and write_ops you have measured?<br>
<br>
<br>
Since Squid does not (and does not want to) have access to low-level<br>
disk stats and since Squid cannot assume exlusive disk ownership, the<br>
rate-limiting feature for rock cache_dirs does not know how many<br>
low-level disk operations the disk is doing and how those operations<br>
correspond to what Squid is asking the disk to do.<br>
<br>
<br>
HTH,<br>
<br>
Alex.<br>
<div><div class="h5"><br>
<br>
> I tried to set it to 200 to confirm that it actually works and saw that<br>
> it does. Squid started warning about exceeding max-swap-rate. But looks<br>
> like real limit is higher than the value we set in configuration.<br>
><br>
> Hardware:<br>
><br>
> AWS GP2 EBS (SSD) 600GB, 1500 iops baseline performance, 3000 iops<br>
> burstable.<br>
><br>
> Config:<br>
><br>
> cache_dir rock /mnt/services/squid/cache 435200 swap-timeout=500<br>
> max-swap-rate=1200 slot-size=16384<br>
><br>
> IOPS squid pushes under our load test:<br>
><br>
> read ~800 ops/sec<br>
> write ~1100 ops/sec<br>
><br>
> In summary it gives us ~1900 ops/sec which exceeds AWS limit of 1500<br>
> ops/sec and after spending too much "burst balance" we started getting<br>
> throttled from AWS side.<br>
><br>
> Could you please comment on this behavior? What the limit should we set<br>
> to stay under 1500 ops/sec for swap in + swap out operations?<br>
><br>
> Thanks.<br>
><br>
> Squid version:<br>
><br>
> Squid Cache: Version 4.0.22<br>
> Service Name: squid<br>
> configure options:  '--program-prefix=' '--prefix=/usr'<br>
> '--exec-prefix=/usr' '--bindir=/usr/sbin' '--sbindir=/usr/sbin'<br>
> '--sysconfdir=/etc/squid' '--libdir=/usr/lib'<br>
> '--libexecdir=/usr/lib/squid' '--includedir=/usr/include'<br>
> '--datadir=/usr/share' '--sharedstatedir=/usr/com'<br>
> '--localstatedir=/var' '--mandir=/usr/share/man'<br>
> '--infodir=/usr/share/info' '--enable-epoll'<br>
> '--enable-removal-policies=<wbr>heap,lru' '--enable-storeio=aufs,rock'<br>
> '--enable-delay-pools' '--with-pthreads' '--enable-cache-digests'<br>
> '--with-large-files' '--with-maxfd=16384' '--enable-htcp'<br>
><br>
> --<br>
> With best regards, Ivan Larionov.<br>
><br>
><br>
</div></div>> ______________________________<wbr>_________________<br>
> squid-users mailing list<br>
> <a href="mailto:squid-users@lists.squid-cache.org">squid-users@lists.squid-cache.<wbr>org</a><br>
> <a href="http://lists.squid-cache.org/listinfo/squid-users" rel="noreferrer" target="_blank">http://lists.squid-cache.org/<wbr>listinfo/squid-users</a><br>
><br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">With best regards, Ivan Larionov.</div>
</div>