can we set max cache size? like 1mb of cache?

Roberto Spadim escreveu:
>today implementation don't have problems!
>
>maybe an new directory could help, see:
>
>when we get from "/#OW SYSTEM#/#ANY FILE OR DIRECTORY#" (could be 
>"/ow_device_manager/#ANY FILE OR DIRECTORY#")
>OW SYSTEM:
>     ow system that's connected direct to ds2480 or ds2490 or another 
>dsxxxx
>
>this directory could work like this:
>
>init(" owserver ");
>get(" settings values ");
>put("/settings/timeout/network",0);
>put("/settings/timeout/stable",0);
>put("/settings/timeout/volatile",0);
>put("/settings/timeout/ another timeout configurations ",0);
>$value=get(" getting now will be expired cache value, we will get from 
>owserver :) ");
>put(" set settings back again ",setting_value);
>echo "$value";
>
>i can do it with php, but time to change and set again configuration is 
>very big for a single read.
>
>*****************
>cache system ideas:
>
>SQLITE
>sqlite good things:
>we can SEE the cache
>
>good thinks about sqlite library (www.sqlite.org):
>Small code footprint: less than 250KiB fully configured or less than 150KiB 
>with optional features omitted.
>Supports databases up to 2 terabytes (241 bytes) in size. (no problem with 
>264 device)
>A complete database is stored in a single disk file.
>Implements most of SQL92.
>Zero-configuration - no setup or administration needed.
>Self-contained: *no external* dependencies.
>
>
>*have windows and posix support!!!!*
>
>SQLITE PROBLEMS:
>     maybe anyone could delete file or change table values or put incorrect 
>values on cache system, write lock on file must be done
>     if sqlite is used with ":memory:" (in memory database) just owserver 
>will see the database, may be it could be used only with filesystem cache
>
>if sqlite is faster than today implementation AND with small footprint, we 
>could change today implementation for non uclinux compilations too, we need 
>to see if memory usage is bigger or small with sqlite library too
>
>we don't need to delete expirate values, a field could say the last time 
>that cache was updated and an SQL statment could filter the value like: 
>"SELECT value FROM cache_table WHERE file='balbalbal' AND expiration_time>= 
>current_time ", maybe when owserver end or start database could be 
>cleaned...
>
>
>ANOTHERS
>
>anothers cache systems could be: the system used in MMTurck or eaccelerator 
>or APC or memcache (php libraries from pecl.php.net) or  Berkeley DB or
>(http://www.danga.com/memcached/) :
>Memcached is a caching daemon designed especially for dynamic web 
>applications to decrease database load by storing objects in memory.
>MEMCACHE PROBLEMS:
>     server must run before ow,
>     could be used for non uclinux too,
>     maybe sqlite could be faster, if disk write and read is faster than IP 
>communication.
>     If memcache server die or don't work what could we do?
>     i didn't see documentation of memcache, but i think that we can't see 
>all cache contents like an "SELECT * FROM cache_table"
>
>COMMENTS:
>
>i don't know if database systems could help, we need fast systems and i 
>don't like another program running like mysqld or oracle daemon or 
>postgrees daemon or firebird daemon or XXX daemon, maybe embbeded solutions 
>like sqlite or filebased databases could help. without server running cache 
>is locked, using filebased database we just need file access to write and 
>read, today i just run owserver with root... i don't have privileges 
>problems for files, for windows the same thing just run like administrator
>if we will use filebased, we need to remember that files can be shared... 
>if we put it on network filesystems maybe many owserver can use the 
>samefile and table conflicts could occur like duplicated settings values, 
>we need to put mac address to know what server we are, or another unique 
>ID...
>just building to test and know if it really work...
>
>
>Paul Alfille escreveu:
>
>>Hi Robero. You certainly are exploring the entire program!
>>
>>Currently the cache is an in-memory binary tree. There is some information 
>>at http://www.owfs.org/index.php?page=cache 
>><http://www.owfs.org/index.php?page=cache>
>>
>>Several different things are cached:
>>1. devices (basically if a serial number was found, and on which bus)
>>2. directory lists (lists of serial numbers for a given path)
>>3. "file" contents ( things like serialnumber/temperature )
>>4. Hidden properties (like cumulative counters, and barometer calibration 
>>factors)
>>
>>Cached items also store their termination time.
>>
>>We actually use two binary trees, one for new entries, and one that is 
>>older. The older one doesn't get updated, and eventually expires entirely, 
>>and gets deleted. At that point, the newer one becomes the older one, and 
>>a new one is started.
>>
>>This means that we never have to scan through all the items with see which 
>>are too old, and stale entries are guarnteed to be deleted in a reasonable 
>>time period.
>>
>>So, could the cache be stored in SQLite? Sure. Could it be backed up by a 
>>physical file? Sure. What would the advantage be? Binary trees are quite 
>>fast for adding and retrieving. Glibc and uClibc both have support built 
>>in for binary trees so external libraries are needed.
>>
>>There are some problems with the current scheme. If you have owfs 
>>connecting to owserver, each has it's own cache. It is possible for the 
>>caches to be out of synch, especially if several programs are connected to 
>>owserver. Reading "uncached" values will always work, and cache problems 
>>time themselves out quickly in any case.
>>
>>An alternative design would be a separate owcache program. Cache would be 
>>consistent, and not repeated, but communication efficiency might swamp 
>>space efficiency. I didn't do it because of the complexity.
>>
>>Tell me what you see as the deficiencies of the current scheme.
>>
>>Paul Alfille
>>
>>On 10/14/06, *Roberto Spadim* <[EMAIL PROTECTED] 
>><mailto:[EMAIL PROTECTED]>> wrote:
>>
>>     Hello guys, i was thinking about cache system...
>>     can we use cache in filesystem?
>>     like in sqlite we can use
>>     sqlite_open(":memory:");
>>     to use database on memory and
>>     sqlite_open("/file.sqlite");
>>     to open an file
>>     could we set the "file_name" of cache system?
>>     if we put "NULL" the cache system could be turned off
>>     what you say?
>>
>>     have anyother database system that is fast than today database?
>>     sqlite
>>     could be used? we are using berkley?
>>     could we select "file_name" for
>>     Old Cache data
>>     New Cache data
>>     Persistent data
>>
>>     in diferent "files"??
>>     thankx guys :)
>>
>>     "files" could be memory or real file
>>
>>     
>>-------------------------------------------------------------------------
>>     Using Tomcat but need to do more? Need to support web services,
>>     security?
>>     Get stuff done quickly with pre-integrated technology to make your
>>     job easier
>>     Download IBM WebSphere Application Server v.1.0.1 based on Apache
>>     Geronimo
>>     
>>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>>     
>><http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>
>>     _______________________________________________
>>     Owfs-developers mailing list
>>     Owfs-developers@lists.sourceforge.net
>>     <mailto:Owfs-developers@lists.sourceforge.net>
>>     https://lists.sourceforge.net/lists/listinfo/owfs-developers
>>
>>
>>------------------------------------------------------------------------
>>Esta mensagem foi verificada pelo E-mail Protegido Terra 
>><http://mail.terra.com.br/>.
>>Scan engine: McAfee VirusScan / Atualizado em 13/10/2006 / Versão: 
>>4.4.00/4873
>>Proteja o seu e-mail Terra: http://mail.terra.com.br/
>>------------------------------------------------------------------------
>>
>>-------------------------------------------------------------------------
>>Using Tomcat but need to do more? Need to support web services, security?
>>Get stuff done quickly with pre-integrated technology to make your job 
>>easier
>>Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>>------------------------------------------------------------------------
>>
>>_______________________________________________
>>Owfs-developers mailing list
>>Owfs-developers@lists.sourceforge.net
>>https://lists.sourceforge.net/lists/listinfo/owfs-developers
>>
>
>
>-------------------------------------------------------------------------
>Using Tomcat but need to do more? Need to support web services, security?
>Get stuff done quickly with pre-integrated technology to make your job 
>easier
>Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>_______________________________________________
>Owfs-developers mailing list
>Owfs-developers@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/owfs-developers
>
>Esta mensagem foi verificada pelo E-mail Protegido Terra.
>Scan engine: McAfee VirusScan / Atualizado em 13/10/2006 / Versão: 
>4.4.00/4873
>Proteja o seu e-mail Terra: http://mail.terra.com.br/
>
>
>
>

_________________________________________________________________
Inscreva-se no novo Windows Live Mail beta e seja um dos primeiros a testar 
as novidades-grátis. Saiba mais: 
http://www.ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to