In-memory WSDL cache for ext/soap (was: [SOAP] Frequent crashes in multithreaded webserver sincenew WSDLcaching code in ext/soap)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I made a cleanup of Andrei's patch for caching WSDL in memory.

Now you can enable disk and/or memory cache through configuration directive
"soap.wsdl_cache" in php.ini.
It can have one of the following values WSDL_CACHE_NONE, WSDL_CACHE_DISK,
WSDL_CACHE_MEMORY, WSDL_CACHE_BOTH. The default value is WSDL_CACHE_DISK for
backward compatibility.

In addition you can control caching behavior right in SoapClient/SoapServer
constructor:

$ws = new SoapClient($wsdl, array('wsdl_cache' => WSDL_CACHE_BOTH));

Both disk and memory caches have the same TTL (time to live) value -
"soap.wsdl_cache_ttl".

Also memory cache has an upper limit, that doesn't allow cache to many files
- "soap.wsdl_cache_limit". In case of limit overflow the most oldest file is
removed from the cache.

"soap.wsdl_cache_enabled" directive is stay for backward compatibility.

Please test your SOAP applications with latest 5.1 CVS version or snapshot
(Add "soap.wsdl_cache = WSDL_CACHE_BOTH" into you php.ini)
They should get some performance improvement (thanks to Andrei)

BTW the patch is not trivial, it had a lot of bugs and may be not all of
them are found.
So we need to decide if this feature should go into 5.1.3 or only into next
release.

Thanks. Dmitry.



> -----Original Message-----
> From: Uwe Schindler [mailto:thetaphi@php.net] 
> Sent: Tuesday, April 18, 2006 10:18 PM
> To: Dmitry Stogov; 'Rasmus Lerdorf'; 'Andrei Zmievski'
> Cc: 'Uwe Schindler'; soap@lists.php.net; Andi Gutmans
> Subject: RE:  Frequent crashes in multithreaded 
> webserver sincenew WSDLcaching code in ext/soap
> 
> 
> Hi Dmitry,
> 
> At 19:39 18.04.2006, Dmitry Stogov wrote:
> >Note that in-memory cache is not shared between processes and/or 
> >threads, so if we have 1000 PHP processes we will ask for 
> WSDL files at 
> >least 1000 times and also after each process restart. Also 
> memory usage 
> >will very inefficient in this case.
> 
> It is shared between *threads* (and this is the graet advantage of 
> multithreaded webservers like in my case with SunONE and NSAPI) but 
> you are right, not between processes. So for example CGI, CLI or an 
> apache that is not multithreaded cannot use it correctly (or use 
> shared memory to store the cache, but that would be a lot to do and I 
> think nobody would use it. For example most people store the session 
> also in /tmp (sometimes with a tmpfs) and never use the shm 
> session handler.
> 
> If the wsdl is not loaded before forking other processes in prefork 
> mpm apache, the other processes will not see the memory cache. 
> Without disk cache they must reload the WSDL by HTTP and parse it 
> again => webservers that use multiple processes would not benefit of 
> the whole caching.
> 
> >I think it is better to provide a chose to user use both, 
> memory only, 
> >disk only cahce or don't use cache at all, through configuration 
> >directive.
> 
> Great. And make the TTL php.ini option also available for mem cache.
> 
> >I am not agree to delete disk cache, especially because 
> in-memory cache 
> >wasn't tested enough. And we need to disable in-memory cache 
> by default 
> >for this release because of the same reason.
> 
> +1, but for me it works so telle me your configuration options used
> when you implemented it!
> 
> 
> -----
> Uwe Schindler
> thetaphi@php.net - http://www.php.net
> NSAPI SAPI developer
> Bremen, Germany
> 
> -- 
> PHP Soap Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 

-- 
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux