Best unofficial Apache Server developers community |
| |||||
| Jun 24, 2010 | |||||
|
Pranav Modi |
|
||||
| Tags: | |||||
Similar Threads
More on caching
Hi All
I'm still trying to wrap my head around the Cayenne caching system,
(maybe Friday afternoon isn't doing me any good)
I have a test case as follows:
public void testBasicSelectQueryWithoutDaoWithCache() {
initCache();
assertEquals(0, getDataContext().getQueryCache().size());
SelectQuery q = new SelectQuery(Admin.class);
q.setCacheGroups("testGroup");
q.setCacheStrategy(QueryCacheStrategy.SHARED_CACHE);
List<Admin> result = getDataContext().performQuery(q);
assertEquals(2, result.size());
SelectQuery q2 = new SelectQuery(Admin.class);
List<Admin> result2 = getDataContext().performQuery(q2);
assertEquals(2, result2.size());
assertEquals(1, getDataContext().getQueryCache().size());
}
private void initCache() {
DataContext context = (DataContext) getDataContext();
DataDomain domain = context.getParentDataDomain();
domain.setQueryCacheFactory(new OSQueryCacheFactory());
domain.setSharedCacheEnabled(true);
this.osCache = true;
}
I would expect that the the second query q2 would not execute any SQL
however the QueryLogger logs the second select statement.
Also the assert on the query cache size fails the it appears the size
is zero rather than 1 as I would have expected.
If I change the second call to performQuery to query q (List<Admin>
result2 = getDataContext().performQuery(q);) then in the log I get
DEBUG [AbstractConcurrentReadCache.java:694] => get called (key=Admin)
but the cache size in the last Assert is still 0 ???
I've read through the docs a few times and I can not see what I am doing
wrong.
Thank you
Gary
Key Caching
I am trying to use the key cache, and I had some basic questions as to how it works. There seem to be settings based on % and total count, but not on total cache size like most caching mechanisms. Is the cache stored in the jvm heap or somewhere else? We have 24gb RAM nodes with a 8gb jvm heap size. Is the key cache sharing the 8gb heap or is it separate? Can we end up pushing out to swap if the key cache gets too big (if not in jvm)? We would prefer to set the jvm heap to 8gb and key cache to 8-10 gb, and then do some testing with cache hit rates to determine how many nodes we need to keep most keys in cache. High key cache hit rates are vital to good read performance, and we need some help to figure out the best way to optimize/design our cluster. What is the the key cache capacity in cfstats? How is this calculated? I also see the stats get reset often and cache is cleared quite often, what triggers the flushing of key cache? Is it compaction? Given that our keys do not change too much we would prefer them to stay within cache as long as possible. We have a very wide data model so having all keys in cache is a realistic possibility for us, we just need some help figuring out how to design our cluster for this. We are currently testing with 4 nodes with replication factor of 3 (24gb ram 8 core), and we plan to expand the node count as required to fit most/all keys into memory. Thanks in advance for any help you can provide. Wayne
caching proxy
Hi, I did try to read apache docs given here. http://httpd.apache.org/docs/2.2/mod/....html#cacheenable http://www.google.co.in/search?hl=en&...;oq=&gs_rfai= actually I am a bit new to this so if some one can let me know. I am having a reverse proxy based website. The reverse proxy forwards any request to main website to an internal server.Looks like this I tried putting CacheEnable disk http://site5.abc.com/ but after that apache2 failed to restart how should I do that can any one let me know. <VirtualHost *:80 > ServerName site5.abc.com ServerAdmin webma### @localhost ServerName site5.abc.com ProxyRequests off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass / http://192.168.1.5 ProxyPassReverse / http://192.168.1.5 ErrorLog /var/log/apache2/site5_error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/site5_access.log combined </VirtualHost>
mod_ldap not caching
Hi Gurus,
I have a subversion server that authenticates with windows ad and i
want to cache my authentication for better performance.
here's my setting:
LoadModule authnz_ldap_module
/usr/lib/apache2-prefork/mod_authnz_ldap.so
LoadModule ldap_module
/usr/lib/apache2-prefork/mod_ldap.so
LDAPTrustedMode SSL
LDAPVerifyServerCert off
LDAPSharedCacheSize 500000
LDAPCacheEntries 1024
LDAPCacheTTL 43200
LDAPOpCacheEntries 1024
LDAPOpCacheTTL 43200
LDAPSharedCacheFile /srv/home/svn/ldap_cache
LDAPConnectionTimeout 10
<Location /ldap-status>
SetHandler ldap-status
Order allow,deny
Allow from all
</Location>
LDAPTrustedClientCert CERT_BASE64 /etc/apache2/ssl.crt/ad1.cer
LDAPTrustedClientCert CERT_BASE64 /etc/apache2/ssl.crt/ad2.cer
<Location /unix-repo>
DAV svn
SVNPath /srv/svn/unix-repo
AuthName "Please use your ACTIVE DIRECTORY for Authentication"
AuthType Basic
AuthBasicProvider ldap
AuthzLDAPAuthoritative off
Include /etc/apache2/.ldapbinddn
AuthLDAPURL "ldaps://172.23.12.137
172.23.12.136:636/DC=domain,DC=local?sAMAccountName?sub?(objectClass=user)"
SSLRequireSSL
AuthzSVNAccessFile /srv/config/svn_acl/unix-repo
Require valid-user
SVNPathAuthz off
</Location>
Browsing https://localhost/ldap-status show an empty LDAP Cache
Information
Can anyone help me, what's missing?
Thanks,
West
HttpClient 4.1 API freeze / Caching API
Folks I would like to start moving towards the freeze of 4.1 API. All new features added in trunk since 4.0 seem reasonably okay. The only thing that still blocks the 4.1-beta1 release is the the relatively untested API of the recently added caching module. I personally find it difficult to decide for myself whether the design is flexible enough unless there are other implementations (for instance, a file system or a ehache based) of the same API. I see three different approaches we could pursue: (1) Take more time to stabilize HttpClientCache API at the price of delaying 4.1 GA. (2) Freeze the API of HttpClient and HttpMime and clearly state HttpClientCache is still experimental and its binary / API stability cannot be guaranteed, despite being a part of a GA release (3) Reduce the API to a bare minimum (make pretty much all but a few must-have classes package private, make protected methods of public classes private, etc) and gradually relax the restriction on class / method visibility as the module matures. What do you think? I am kind of leaning towards the last option. Oleg
Caching catalog does not scale
Hello I noticed that the time needed by puppetd to write on disk its cached catalog has increased a lot in Puppet 0.25. I'm using 0.25.4 and, with a catalog with around: ~400 resources: i need 3 sec to write this on disk ~900 resources: i need 8 sec ~1900 resources: i need 21 sec. I really have catalogs with 900 resources, in production., 1900 was only to test the problem. But I'm sure this value will increase. I do not reproduce this issue with Puppet 0.24.
PATCH] Caching API review
Jon et al I started looking at the Caching API more closely primarily to find out how difficult / feasible it should be to put together alternative cache backends such as echache or file system based. I stumbled upon a few minor issues I thought I should discuss with you. (1) HttpCacheUpdateCallback I think I understand the rationale behind the interface but kind of dislike the fact that its implementations often manipulate the cache behind the scene in non-obvious ways. One call to #updateCacheEntry may result in mutation of multiple entries and multiple invocations of #putEntry methods. Do we need #updateCacheEntry at all? What we need is ability to update the cache while ensuring the consistency of its content. Why not just use an exclusive lock to execute multiple cache operations as a unit of work? Please take a look at the patch attached and let me know if you can live with the proposed changes? (2) Do we really need HttpCacheEntrySerializer? It does not appear to be used anywhere but in tests. Oleg
Caching issue in CAMEL
Hello In my route, I have 2 endpoints that shares the same real URL underneath. To be clear, the difference between the 2 endpoints is the dataFormat mode: one is PAYLOAD and the other is POJO. The idea was to be able to performance test each of theses routes independently while sharing most of the route definition. It seems this is not possible because the cache use the endpoint URL as a key (which is the same with my 2 Endpoints) Is there any way to fix this behaviour? I have indeed seen that the ProducerCache has a doGetProducer method with a pooled parameter, but that parameter is always set to "true". Cheers Office: +33 4 76 29 76 19 GSM: +33 66 43 00 555 Bull, Architect of an Open World TM http://www.bull.com
Apache as caching proxy
Hi, I have an installation of Apache running, so thinking of using it as a personal caching server after being fed up of firefox crashes which clears the cache. I have set it up using the manual and some guides using Google, but how do I know that its working ? Here are my settings: ProxyRequests On ProxyVia Off ProxyBadHeader Ignore ProxyStatus On <Proxy *> Order deny,allow Deny from All Allow from 192.168.1.0 127.0.0.1 localhost </Proxy> AllowCONNECT 443 CacheDefaultExpire 3600 CacheMaxExpire 604800 CacheIgnoreCacheControl On CacheStorePrivate On CacheStoreNoStore On CacheIgnoreNoLastMod On CacheRoot /home/proxy_cache CacheEnable disk / CacheMaxFileSize 5242880 CacheIgnoreURLSessionIdentifiers jsessionid PHPSESSID sid What happens if I remove the CacheMaxExpire directive ? Will Apache check for the document's last-modified time ? I would like latest stuff on websites I visit, so please guide me in the right direction.
0.25.4 caching problem with custom function
I'm not 100% sure if the subject correctly describes the problem I've been having, but it's the closest I can get with my troubleshooting. My setup looks like this: * 2 puppetmasters running 0.25.4 on Ubuntu, running under passenger * backend content (etc and var) shared over NFS * haproxy load balancing across the 2 puppetmasters * mysql for stored configs I just upgraded from 0.24.8 to 0.25.4 a couple of weeks ago. The setup we've been using above has worked fine since we implemented it months ago, so I don't believe that there is any problem with NFS or the load balancer. I have a handful of custom functions, and after updating to 0.25.4, puppetmaster started complaining about one of them, a simple function called nagios_name. This function takes an FQDN and turns it into a name we use in Nagios and mcollective (turning "support.arces.net" into "arces.support" for example). The function is basic ruby and is available for you to look at here: http://monachus.pastebin.com/yLF1syqU. The function works fine. The error that puppetmaster reports is: Unknown function nagios_name at /var/www/localhost/puppet/etc/ manifests/outsidein_nodes.pp:16 on node some.node.com. It doesn't report this all of the time - instead it reports it about 40% of the time, while other nodes before and after it do not report the error. It seems that a node with a problem will always have the problem, and a node where it works will always work. This reinforces the fact that the function is fine - it works and has worked for months. My thought is that it's some sort of caching issue, and I even thought it might be a race condition with the backend storage being NFS - one puppetmaster loading a cached yaml file before the other was done writing it or something. I've done all of the following, all with no success: * turn off one puppetmaster so traffic isn't split across them * move yaml files for node/facts to local storage instead of NFS * enable IP-based persistence in haproxy so that traffic from a client always goes to the same puppetmaster * --ignorecache in config.ru for puppetmaster What I've discovered, however, is more interesting. It appears that if I go into the actual nagios_name.rb file and change it in any way (add a single character of whitespace) and restart Apache, the error goes away. The file is detected as different and loaded for delivery to the clients, and everything works fine after that. I discovered this by adding debug() statements to the function 2 weeks ago, only to find that it worked fine from then on. The problem resurfaced today when I turned the 2nd puppetmaster back on, and I decided to try it with whitespace - same thing. Clears it right up. This tells me that there is some sort of caching wonkiness happening somewhere, but I'm not able to figure out where. Perhaps one of the variables the function is looking for (fqdn?) isn't available at the time it's requested, resulting in a compile error that isn't always visible? I'm pleased to have a workaround, but to go from "Unknown function" to "everything is cool" by adding a space to the file and saving it isn't really much of a long-term solution. I'm sending this to the list rather than filing a bug report to see if anyone has experienced anything like this or has any thoughts. If there's any further information I can give to help narrow down the source of the problem, I'm happy to do so. Adrian
Lazy Loading + Caching - Incompatible?
Hi, I just wanted to confirm that lazy-loading and caching in myBatis is incompatible because of serialization issues with the enhanced versions of objects loaded in a result-map. I have tried to use a different caching implementation (EHCache), but the same problem arises, as myBatis appears to always make a call to serialize(...) in the SerializedCache class before sending the value to the custom caching solution. Is there anyway to bypass this serialization feature for a pure in- memory cache (other than with a custom build)? Thanks in advance, Mike
Is it possible to disable caching/force reloading of JNDI resources?
Hi guys, I'm stuck with a JNDI resource object factory problem. Hopefully you can help me out with this issue. My idea was to provide multiple web applications running inside a Tomcat instance with configuration properties from config files located outside the WAR file of the applications. I'm currently trying to provide these configuration properties with a global naming resource (defined inside the server.xml) which is consumed by the said applications to keep the configuration container independent and to avoid direct file access from a web application. So far almost everything already works perfectly! Except that Tomcat obviously caches resources which are looked up via JNDI. This way I have to restart Tomcat every time the external config files changes because the web applications never access my ObjectFactory again after Tomcat has cached the result of the ObjectFactory. Accordingly to the documentation an implementation of ObjectFactory should be accessed each time a web application looks it up with its JNDI key. But that's definitely not the case here. Any ideas or thoughts on this issue? Is there any way to disable this behavior of Tomcat's JNDI resource management? Or any comments on this plan to externalize the application configuration in general? Thanks in advance! Marco
Re: Is it possible to disable caching/force reloading of JNDI resources?
Am 17.07.2010 12:56, schrieb Mark Thomas: On 17/07/2010 09:50, Marco Ehrentreich wrote: > Accordingly to the documentation an implementation of ObjectFactory > should be accessed each time a web application looks it up with its JNDI > key. But that's definitely not the case here. What documentation? Mark Sorry, I'll try to find the said documentation again. I think it was something from the original Tomcat documentation but I can't find it at the moment. Maybe I missunderstood it but at least it didn't mention that the result of an ObjectFactory is only produced once and then cached by Tomcat. Can you tell me some more details about this issue? Or would you recommend a completely different approach? Marco
Created: (HTTPCLIENT-972) caching module should use HttpParams-style configuration
caching module should use HttpParams-style configuration
Created: (HTTPCLIENT-962) client cache may be a shared cache but is caching responses to requests wi
client cache may be a shared cache but is caching responses to requests with Authorization headers
Working C example?
Hi, looking in the http://activemq.apache.org/c-integration.html C cross-client implementations http://svn.apache.org/repos/asf/activemq/sandbox/openwire-c/ OpenWire and http://svn.stomp.codehaus.org/browse/stomp/trunk/c/ STOMP C implementations, I see only prototype code, which project would be most easy to get running though? Does anyone have a working example or experience building one of the prototype C implementations (possibly with brief build/run instructions)??? It would be GREATLY appreciated! I need to get a JMS consumer/producer going using C, like yesterday!!
SSL Not working on tomcat 5.5.29
Hi All, I am working on upgrading tomcat from 5.5.28 to 5.5.29 for one of the applications. I see that the website renders and works fine in 5.5.29 on port 8080 (non SSL) but with SSL (port 8443) the website doesnot run at all. When I try to see what's going on in Fiddle, I see 502 error. Also nothing is written to the log flies. It is as if tomcat is not even running in port 8443. Under tomcat 5.5.28, the site renders fine with SSL and non SSL. Is there something I could be missing? Regards, Kareem
trying to ban IPs using htaccess - not working
I'm trying to ban certain IPs from visiting my site, so that they instead see a message saying "Your IP has been banned, email me if you think this is an error." I've *almost* got it working -- when people visit URLs like http://209.160.28.154/index.html or http://209.160.28.154/foo-does-not-exist they see the "banned IP" message. However, the problem is that if you try to access the front page: http://209.160.28.154/ from a banned IP address, you see the "Apache Test Page for CentOS" page, instead of seeing the "banned IP" message. Anybody recognize this problem or have an idea of what could be causing it? In my httpd.conf file, I changed "AllowOverride None" to "AllowOverride All" in both the default <Directory /> tag and inside the <Directory "/var/www/html"> tag -- I placed a modified copy of httpd.conf at: http://209.160.28.154/httpd.conf and in /var/www/html I placed a .htaccess file containing these lines: >>> ErrorDocument 403 /banned_ip.php order deny,allow deny from 71.112.32.149 >>> and restarted the server. (The page http://209.160.28.154/banned_ip.php shows the message you're supposed to see when connecting from a banned IP. 71.112.32.149 is my home machine IP which I've "banned" for testing purposes.) So like I said, that almost works, where http://209.160.28.154/index.html gives the right error message, but http://209.160.28.154/ does not. Any idea how to change is to that all URLs under http://209.160.28.154/ will give the "banned IP" message if connecting from a banned IP? -Bennett
Re: anyone working on BCEL ?
On 24/05/2010, Mark Thomas <mar### @apache.org> wrote: On 24/05/2010 22:34, sebb wrote: > Is anyone working on - or wanting to work on - BCEL at present? Try the Jakarta dev list. BCEL isn't a commons component. Duh -sorry! Mark > > I know that Findbugs are keen to get away from using their patched version. > > I can do some tidying up of test cases and basic warnings if that would help. > > There seem to have been a lot of fixes since 5.2, so it would be good > to get a new release out. > >
FileUpload not working
Hi guys, I'm using the Apache Commons FileUpload lib and I'm getting this strange behaviour in just one of my servers. All others work perfectly. servletfileupload.parseRequest(request) always returns an empty list. But if I check for: ServletFileUpload.isMultipartContent(request) This returns true. So, the list should not be empty. I'm really stuck here. Any ideas? Thanks, Fernando
Leveraging browser caching
Jul 13, 2010 rewrite is not working at all Jul 14, 2010 flash not working in friendly url Jul 7, 2010 Kerberos working on the command line, not via apache Jun 4, 2010 mod_jk and tomcat virtual hosts not working properly Jul 26, 2010 Local Apache Stop Working Suddenly (Windows) Jul 26, 2010 HELP! 301 redirects in .htaccess file not working!!! 500 internal server error Jun 4, 2010 | |||||
(34 lines) Jun 24, 2010 01:21
(35 lines) Jun 24, 2010 01:23
(56 lines) Jun 24, 2010 01:38
(18 lines) Jun 24, 2010 01:44
(32 lines) Jun 24, 2010 01:52
(21 lines) Jun 24, 2010 02:01
(58 lines) Jun 25, 2010 01:21
(66 lines) Jun 25, 2010 05:38
(92 lines) Jun 25, 2010 06:01
(91 lines) Jun 25, 2010 06:10
(109 lines) Jun 25, 2010 06:36
(120 lines) Jun 25, 2010 06:53
(88 lines) Jun 25, 2010 11:28