[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [TEKNIK] disc cache, ramdisk, mm.



In <sslug@sslug> =?ISO-8859-1?Q?Atte_Andr=E9_Jensen?= <sslug@sslug> writes:

>1) Hvordan kan jeg (uden at reboote) slette forekomsten af filen i ram, 
>således at anden gang performer ligeså dårligt som første (så jeg ikke 
>skal reboote efter hver test)

Det kræver et program der åbner filen, og bruger posix_fadvise() 
funktionen til at fortælle kernen at den ikke skal cache filen.
D.v.s. et program det gør

    fd = fopen(filename, "r");
    posix_fadvise(fileno(fd), 0, 0, POSIX_FADV_DONTNEED));


>2) Kan man på en pålidelig måde udnytte denne cache? Fx ved at loade 
>alle filer på forhånd i et andet program, således at når mit program 
>skal læse dem går det hurtigere?

Du skal bare begynde at læse filerne. Linux buffer-cache er lavet så
den laver read-ahead på filer, default 8*4 KB så vidt jeg husker.


>3) Jeg forestillede mig at en ramdisk ville kunne løse problemet for 

Det er almindeligvis bedre at lade kernen styre ram-tildeling, og
buffer-cachen er netop beregnet til den slags caching som du vil 
lave.


Mvh,
Henrik



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2007-07-01, 02:02 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *