When I try to download file with size 21K openLiteSpeed should use mmap. But it use sendfile:
read(21, "GET /wp-content/themes/fozzy/intro-experiment/css/style.css HTTP/1.0\r\nReferer: http://dev.fozzy.com/en/intro-experiment-prices\r\nUser-Agent: Wget/1.12 (linux-gnu)\r\nAccept: */*\r\nHost: dev.fozzy.com\r\nConnection: Keep-Alive\r\n\r\n", 2044) = 223
stat("/srv/www/dev/fozzy.com/wp-content/cache/supercache/dev.fozzy.com/wp-content/themes/fozzy/intro-experiment/css/style.css/index.html", 0x737dd8) = -1 ENOENT (No such file or directory)
stat("/srv/www/dev/fozzy.com/wp-content/themes/fozzy/intro-experiment/css/style.css", {st_mode=S_IFREG|0775, st_size=20956, ...}) = 0
stat("/srv/www/dev/fozzy.com/wp-content/themes/fozzy/intro-experiment/css/style.css", {st_mode=S_IFREG|0775, st_size=20956, ...}) = 0
stat("/srv/www/dev/fozzy.com/wp-content/themes/fozzy/intro-experiment/css/style.css", {st_mode=S_IFREG|0775, st_size=20956, ...}) = 0
readlink("/srv/www/dev/fozzy.com/wp-content", 0x7fff6c716e31, 4094) = -1 EINVAL (Invalid argument)
readlink("/srv/www/dev/fozzy.com/wp-content/themes", 0x7fff6c716e31, 4094) = -1 EINVAL (Invalid argument)
readlink("/srv/www/dev/fozzy.com/wp-content/themes/fozzy", 0x7fff6c716e31, 4094) = -1 EINVAL (Invalid argument)
readlink("/srv/www/dev/fozzy.com/wp-content/themes/fozzy/intro-experiment", 0x7fff6c716e31, 4094) = -1 EINVAL (Invalid argument)
readlink("/srv/www/dev/fozzy.com/wp-content/themes/fozzy/intro-experiment/css", 0x7fff6c716e31, 4094) = -1 EINVAL (Invalid argument)
readlink("/srv/www/dev/fozzy.com/wp-content/themes/fozzy/intro-experiment/css/style.css", 0x7fff6c716e31, 4094) = -1 EINVAL (Invalid argument)
open("/srv/www/dev/fozzy.com/wp-content/themes/fozzy/intro-experiment/css/style.css", O_RDONLY) = 22
fcntl(22, F_SETFD, FD_CLOEXEC) = 0
writev(21, [{"HTTP/1.0 200 OK\r\n", 17}, {"cache-control: public, max-age=604800\r\nexpires: Thu, 09 Apr 2015 09:51:37 GMT\r\netag: \"51dc-547f32c1-3f4b3\"\r\nlast-modified: Wed, 03 Dec 2014 15:56:49 GMT\r\ncontent-type: text/css\r\ncontent-length: 20956\r\naccept-ranges: bytes\r\ndate: Thu, 02 Apr 2015 09:51:37 GMT\r\nserver: LiteSpeed\r\nconnection: keep-alive\r\n", 303}, {"\r\n", 2}], 3) = 322
sendfile(21, 22, [0], 20956) = 20956
If I change "Use sendfile()" to "No" then openLiteSpeed starts to use mmap for the same file:
read(21, "GET /wp-content/themes/fozzy/intro-experiment/css/style.css HTTP/1.1\r\nUser-Agent: curl/7.41.0\r\nHost: dev.fozzy.com\r\nAccept: */*\r\n\r\n", 2044) = 1
stat("/srv/www/dev/fozzy.com/wp-content/cache/supercache/dev.fozzy.com/wp-content/themes/fozzy/intro-experiment/css/style.css/index.html", 0x737dd8) = -1 ENOENT (No such file or directory)
stat("/srv/www/dev/fozzy.com/wp-content/themes/fozzy/intro-experiment/css/style.css", {st_mode=S_IFREG|0775, st_size=20956, ...}) = 0
stat("/srv/www/dev/fozzy.com/wp-content/themes/fozzy/intro-experiment/css/style.css", {st_mode=S_IFREG|0775, st_size=20956, ...}) = 0
stat("/srv/www/dev/fozzy.com/wp-content/themes/fozzy/intro-experiment/css/style.css", {st_mode=S_IFREG|0775, st_size=20956, ...}) = 0
readlink("/srv/www/dev/fozzy.com/wp-content", 0x7fff413921d1, 4094) = -1 EINVAL (Invalid argument)
readlink("/srv/www/dev/fozzy.com/wp-content/themes", 0x7fff413921d1, 4094) = -1 EINVAL (Invalid argument)
readlink("/srv/www/dev/fozzy.com/wp-content/themes/fozzy", 0x7fff413921d1, 4094) = -1 EINVAL (Invalid argument)
readlink("/srv/www/dev/fozzy.com/wp-content/themes/fozzy/intro-experiment", 0x7fff413921d1, 4094) = -1 EINVAL (Invalid argument)
readlink("/srv/www/dev/fozzy.com/wp-content/themes/fozzy/intro-experiment/css", 0x7fff413921d1, 4094) = -1 EINVAL (Invalid argument)
readlink("/srv/www/dev/fozzy.com/wp-content/themes/fozzy/intro-experiment/css/style.css", 0x7fff413921d1, 4094) = -1 EINVAL (Invalid argument)
open("/srv/www/dev/fozzy.com/wp-content/themes/fozzy/intro-experiment/css/style.css", O_RDONLY) = 22
fcntl(22, F_SETFD, FD_CLOEXEC) = 0
mmap(NULL, 20956, PROT_READ, MAP_PRIVATE, 22, 0) = 0x7f2569701000
close(22) = 0
writev(21, [{"HTTP/1.1 200 OK\r\n", 17}, {"cache-control: public, max-age=604800\r\nexpires: Thu, 09 Apr 2015 12:24:37 GMT\r\netag: \"51dc-547f32c1-3f4b3\"\r\nlast-modified: Wed, 03 Dec 2014 15:56:49 GMT\r\ncontent-type: text/css\r\ncontent-length: 20956\r\naccept-ranges: bytes\r\ndate: Thu, 02 Apr 2015 12:24:37 GMT\r\nserver: LiteSpeed\r\n", 279}, {"\r\n", 2}, {"@charset \"utf-8\";\n\n@font-face {\n\t\tfont-family: 'Myriad Pro';\n\t\tsrc: url('../fonts/mp-regular-webfont.eot');\n\t\tsrc: url('../fonts/mp-regular-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/mp-regular-webfont.woff') format('woff'), url('../fonts/mp-regular-webfont.svg#MyriadProRegular') format('svg'), url('../fonts/mp-regular-webfont.ttf') format('truetype');\n\t\tfont-weight: normal;\n\t\tfont-style: normal;\n}\n\n@font-face {\n\t\tfont-family: 'Myriad Pro Cond';\n\t\tsrc: url('../fonts/myriadpro-cond-webfont.eot');\n\t\tsrc: url('../fonts/myriadpro-cond-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/myriadpro-cond-webfont.woff') format('woff'), url('../fonts/myriadpro-cond-webfont.ttf') format('truetype');\n\t\tfont-weight: normal;\n\t\tfont-style: normal;\n}\n\n@font-face {\n\t\tfont-family: 'Myriad Pro Cond';\n\t\tsrc: url('../fonts/MyriadPro-SemiboldCond.eot');\n\t\tsrc: url('../fonts/MyriadPro-SemiboldCond.eot?#iefix') format('embedded-opentype'), url('../fonts/MyriadPro-SemiboldCond.woff') format('woff'), url('../fonts/MyriadPro-SemiboldCond.ttf') format('truetype');\n\t\tfont-weight: 600;\n\t\tfont-style: normal;\n}\n\n@font-face {\n\t\tfont-family: 'Myriad Pro Cond';\n\t\tsrc: url('../fonts/MyriadPro-SemiboldCondIt.eot');\n\t\tsrc: url('../fonts/MyriadPro-SemiboldCondIt.eot?#iefix') format('embedded-opentype'), url('../fonts/MyriadPro-SemiboldCondIt.woff') format('woff'), url('../fonts/MyriadPro-SemiboldCondIt.ttf') format('truetype');\n\t\tfont-weight: 600;\n\t\tfont-style: italic;\n}\n\n@font-face {\n\t\tfont-family: 'Rouble';\n\t\tsrc: "..., 20956}], 4) = 14344
epoll_ctl(6, EPOLL_CTL_MOD, 21, {EPOLLIN|EPOLLOUT|EPOLLERR|EPOLLHUP, {u32=21, u64=21}}) = 0
epoll_wait(6, {}, 10, 100) = 0
epoll_wait(6, {{EPOLLOUT, {u32=21, u64=21}}}, 10, 100) = 1
writev(21, [{" none;\n\t\tmargin: 22px 0 68px 0;\n\t\tpadding: 0;\n}\n\n.menu2 > ul > li > ul > li {\n\t\tmargin: 22px 0 0 0;\n}\n\n.en .menu2 > ul > li > ul,\n.en
menu2 > ul > li > ul > li {\n\t\tmargin-top: 27px;\n}\n\n.en .menu2 > ul > li > ul {\n\t\tmargin-bottom: 78px;\n}\n\n.btn-hold {\n\t\tmargin: 60px 5px 0 5px;\n}\n\n.top-text .btn-hold {\n\t\tmargin-top: 56px;\n}\n\n.clouds-bg h3 {\n\t\tdisplay: none;\n}\n\n.clouds-bg .btn-hold {\n\t\tmargin-top: 66px;\n}\n\n.benefits .btn-hold {\n\t\tmargin-top: 63px;\n}\n\n.about .btn-hold {\n\t\tmargin-top: 59px;\n}\n\n.btn {\n\t\tdisplay: block;\n\t\tposition: relative;\n\t\ttext-decoration: none;\n\t\tcolor: #fff;\n\t\tvertical-align: top;\n}\n\n.btn .t {\n\t\tposition: relative;\n\t\tfont-family: \"Myriad Pro Cond\", \"Trebuchet MS\", Arial, Helvetica, sans-serif;\n\t\tfont-weight: 600;\n\t\tfont-style: italic;\n\t\tfont-size: 33px;\n\t\ttext-transform: uppercase;\n\t\tletter-spacing: 1px;\n\t\tdisplay: inline-block;\n\t\tpadding: 3px 41px 0 41px;\n\t\theight: 77px;\n\t\tline-height: 77px;\n\t\tdisplay: block;\n\t\ttext-align: left;\n}\n\n.top-text .btn,\n.top-text .btn .t {\n\t\tdisplay: inline-block;\n}\n\n.top-text .btn .t {\n\t\tpadding-left: 87px;\n\t\tpadding-right: 87px;\n\t\theight: 68px;\n\t\tline-height: 68px;\n}\n\n.btn .b {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\t-moz-transform: skew(-10deg);\n\t\t-o-transform: skew(-10deg);\n\t\t-webkit-transform: skew(-10deg);\n\t\ttransform: skew(-10deg);\n}\n\n.btn:hover .b {\nfilter:progid:DXImageTransform Microsoft.Alpha(opacity=90);\n\t\topacity: 0.9;\n}\n\n.top-text .btn .b {\n\t\tbackground: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHh"..., 6910}], 1)
So it looks like a bug: openLiteSpeed ignores option "Max MMAP File Size" and always uses sendfile when it enabled. This behavior reduces page loading speed when it has a lot of js-, css- & small images.
$ /usr/local/lsws/bin/litespeed --version
LiteSpeed/1.3.9 Open