NFS Caching Issue

6

Estamos com um problema que ocorre intermitentemente durante uma implantação de código. O NFS armazena em cache os arquivos à medida que são lidos, mas se um arquivo for lido durante a implementação de um código, ele permanecerá em estado sujo, como se o arquivo não tivesse sido alterado durante a implantação. A única maneira de aliviar esse problema é limpando o cache do NFS após a implantação.

Nosso servidor retorna páginas em branco para todas as solicitações até que o cache do NFS seja limpo.

Existe uma configuração ou alguém tem uma sugestão sobre como corrigir isso?

Estamos executando o NFS v3 no momento.

    
por Michael 21.10.2014 / 17:08

2 respostas

5

Existem opções diferentes para armazenar o atributo do arquivo em cache em uma montagem NFS (lado do cliente):

NOAC
Use the noac mount option to achieve attribute cache coherence among multiple clients. Almost every file system operation checks file attribute information. The client keeps this information cached for a period of time to reduce network and server load. When noac is in effect, a client’s file attribute cache is disabled, so each operation that needs to check a file’s attributes is forced to go back to the server. This permits a client to see changes to a file very quickly, at the cost of many extra network operations.

lookupcache=none
If the client ignores its cache and validates every application lookup request with the server, that client can immediately detect when a new directory entry has been either created or removed by another client. You can specify this behavior using lookupcache=none. The extra NFS requests needed if the client does not cache directory entries can exact a performance penalty. Disabling lookup caching should result in less of a performance penalty than using noac, and has no effect on how the NFS client caches the attributes of files.

actimeo=n
Using actimeo sets all of acregmin, acregmax, acdirmin, and acdirmax to the same value.

  • acregmin=n, The minimum time (in seconds) that the NFS client caches attributes of a regular file before it requests fresh attribute information from a server. If this option is not specified, the NFS client uses a 3-second minimum.
  • acregmax=n, The maximum time (in seconds) that the NFS client caches attributes of a regular file before it requests fresh attribute information from a server. If this option is not specified, the NFS client uses a 60-second maximum.
  • acdirmin=n, The minimum time (in seconds) that the NFS client caches attributes of a directory before it requests fresh attribute information from a server. If this option is not specified, the NFS
    client uses a 30-second minimum.
  • acdirmax=n, The maximum time (in seconds) that the NFS client caches attributes of a directory before it requests fresh attribute information from a server. If this option is not specified, the NFS
    client uses a 60-second maximum.

Extraído da página de manual do NFS .

Espero que isso ajude.

    
por 29.10.2014 / 18:04
0

Você está especificando muitas opções de NFS, a maioria das quais (rsize / wsize / soft) não são necessárias porque elas já são (geralmente) os padrões (no Linux);

NFS Mount Options rsize=32768,wsize=32768,timeo=30,retrans=10,intr,noatime,soft,async,nodev

No entanto, se você estiver executando o Linux, provavelmente deverá procurar configurar as seguintes opções de NFS;

actimeo=3 (configura o acreg [max | min], acdir [max | min], pode ser reduzido para 1 se você ainda estiver vendo problemas de velocidade)

lookupcache=none (ignora completamente o cache, o padrão é "all")

noac (desativa o armazenamento em cache de atributos)

Esta postagem no blog parece ter mais informações

    
por 30.10.2014 / 15:08

Tags