Tag Info

Hot answers tagged

32

I prefer to do a more complete cache header, in addition to some more file extensions. The '?' prefix is a 'non-capturing' mark, nginx won't create a $1. It helps to reduce unnecessary load. location ~* \.(?:ico|css|js|gif|jpe?g|png)$ { expires 30d; add_header Pragma public; add_header Cache-Control "public"; }


18

vmtouch seems like a good tool for the job. Highlights: query how much of a directory is cached query how much of a file is cached (also which pages, graphical representation) load file into cache remove file from cache lock files in cache run as daemon vmtouch manual EDIT: Usage as asked in the question is listed in example 5 on vmtouch Hompage ...


13

Linux will cache as much disk IO in memory as it can. This is what the cache and buffer memory stats are. It'll probably do a better job than you will at storing the right things. However, if you insist in storing your data in memory, you can create a ram drive using either tmpfs or ramfs. The difference is that ramfs will allocate all the memory you ask ...


13

server { ... location ~* \.css$ { expires 30d; } ... } The location directive The expires directive


13

Default TTL can be passed through the varnishd command via the -t commandline switch and is probably sourced from a properties file on your filesystem. On the CentOS system I'm looking at it is set using DEFAULT_TTL from /etc/sysconfig/varnish. You can see the live setting using varnishadm like so, varnishadm param.show default_ttl Actually, following ...


12

After some extensive reading on the 2.6 kernel swapping and page-caching features I found 'fcoretools'. Which consists of two tools; fincore: Will reveal how many pages the application has stored in core memory fadvise: Allows you to manipulate the core memory (page-cache). (In case someone else finds this interesting I'm posting this here)


11

This is in the default template: sub vcl_fetch { if (beresp.ttl <= 0s || beresp.http.Set-Cookie || beresp.http.Vary == "*") { /* * Mark as "Hit-For-Pass" for the next 2 minutes */ set beresp.ttl = 120 s; return (hit_for_pass); } return (deliver); ...


11

You're over-thinking this. Of course, this depends slightly on the manufacturer's specific implementation, but having deployed thousands of HP ProLiant servers over 10 years, I've experienced hundreds of RAID controller battery failures. I replaced the bad units, knowing that sudden power-loss or a system crash would result in some level of data corruption ...


9

This is also possible using the vmtouch Virtual Memory Toucher utility. The tool allows you to control the filesystem cache on a Linux system. You can force or lock a specific file or directory in the VM cache subsystem, or use it to check to see what portions of a file/directory are contained within VM. How much of the /bin/ directory is currently in ...


9

A poor man's trick for getting stuff into the filesystem cache is to simply cat it and redirect that to /dev/null.


8

The only proper way of disabling browser caching is by HTTP headers from the webapp itself. The HTTP 1.1 "Cache-Control" header alone should suffice for any post-year-2000 browser. But for extra protection the server can emit both HTTP 1.1 "Cache-Control" and HTTP 1.0 "Expires" headers together. A hack'ish but sometimes seen way of handling cache ...


8

The MySQL query cache does indeed cache the results of the query and as long as subsequent queries are exactly the same, the calculated result will be provided instead of actually running the query. MySQL will also skip calculating the execution plan. To use it, you can either turn it on in your server's my.cnf or use the SQL_CACHE hint in front of your ...


7

You might have to delete the application cache folder in /work/Catalina/localhost after changing the cachingAllowed flag.


7

You can also set the expires to maximum. Here is the directive I use for css and js. # Set css and js to expire in a very long time location ~* ^.+\.(css|js)$ { access_log off; expires max; }


7

Yes, there is. That said - it is likely your (likely cheap end user) NAS simply does not support that. Adaptec enterprise RAID cards of the latest generation support that even with write cache (6805Q). ZFS file system supports level 2 caches. Every higher level SAN supports significant caches and tiered storage. Cheap end user level SAN? No ;)


6

This is not a bad architecture (squid is a popular reverse proxy), however if you expect exponential growth a Content Delivery Network could be a better solution - you only pay for content that you require, bandwidth scales instantly (you don't have to scale out more servers) and streaming transfer is geolocated to servers as close to the client as possible, ...


6

I had this problem in Tomcat 7 and the reason was that I had antiResourceLocking set to true (it sounded like a good idea...). According to the docs ( http://tomcat.apache.org/tomcat-7.0-doc/config/context.html ): Please note that setting this to true has some side effects, including the disabling of JSP reloading in a running server: see Bugzilla ...


6

$telnet ip_of_memcached_host 11211 or $nc ip_of_memcached_host 11211 stats STAT pid 117 ... STAT limit_maxbytes 67108864 .... STAT evictions 0 END stats slabs .... STAT total_malloced 30234456 END or use favorite programming language api for memcached


6

From a protection perspective, there is no additional data loss potential from having a writeback cache enabled during a rebuild operation. Some controllers disable the writeback cache because they don't have enough processor overhead to be able to manage the writeback cache and a rebuild at the same time. Or their firmware is not sophisticated enough to be ...


5

Yes it can and it is called a reverse proxy when it is on the server side (as opposed to forward proxy on the client side). You can check some information from the squid wiki here and wikipedia here.


5

Here are some popular, industry standard techniques to increase your speed. You can try them out depending on your exact configuration: Memcached Memcached is a general-purpose distributed memory caching system that is often used to speed up dynamic database-driven websites by caching data and objects in RAM to reduce the number of times an external data ...


5

By the look at the variables you've set, it seems like you are mostly concerned with write performance and do not care about possible data losses due to power outages. You only will ever get the option for lazy writes and the use of a writeback cache with asynchronous write operations. Synchronous write operations require committing to disk and would not be ...


5

DNS is a well-defined protocol, and caching is not a magic black box - all behaviour is precisely defined. If your caching server needs to retrieve a new RR, it will traverse the hierarchy iteratively, like any DNS server would (providing you have no forwarders configured, which you shouldn't), and then ask a nameserver that is authoritative for ...


5

You don't need to specify scheme for hostname and you may use strict match instead of regex: varnishadm -T 127.0.0.1:6082 -S /etc/varnish/secret ban "req.http.host == example.com && req.url == /some/url/"


5

You'd want something like this in your vcl_recv: if (req.url ~ "^/path/to/exclude/") { return (pass); } You'll probably need to familiarize yourself with the basics of what the default VCL is doing and adjust for your content - for example, by default, it'll avoid caching anything when the client sends any cookies on the assumption that your content ...


4

HTTP allows responses to be cached, even if they don't have explicit Expires or Cache-Control headers. Specifically, they're allowed to calculate their own so-called heuristic freshness for responses with certain HTTP status codes (including 200 OK). Usually, this is based upon the value of the Last-Modified header; e.g., if LM is 1 day ago when the ...


4

Take a look at this article: http://learn.iis.net/page.aspx/154/walkthrough-iis-70-output-caching/ Some highlights: Things aren't cached right away, they must be configured a few times to be considered cache-worthy. The ServerRuntime config section determines cache-worthiness. (Defaults to 2 requests in 10 seconds to be added to the cache) The Web Service ...


4

The question you should ask when choosing between RAM and SSD is, "How much does my application really need to use the disk?" If you have an application that is mostly scripts doing computation and sending custom versions of pages to users and handling the same kind of requests over not very much data over and over again, then RAM is what you need. If, ...


4

(Sorry it's been a little while since the question was posted, but hopefully this info will be useful to the OP and/or future visitors ...) Your assumptions above are generally correct. NetStorage is a hosted origin service, in Akamai's cloud, on their backbone. Re cost, I believe NetStorage is a free option, at least with a certain level of service, but ...


4

If it's high availability you need, then Windows/SQL Server Clustering or SQL Server Database Mirroring offer solutions. Clustering does require a lot of planning and familiarisation if you've never done it before, but it will be transparent to the application. Load balancing is possible with SQL Server, but it's not for the faint hearted. It's a solution ...



Only top voted, non community-wiki answers of a minimum length are eligible