stef...@apache.org writes:

> Author: stefan2
> Date: Sun Aug  8 19:41:11 2010
> New Revision: 983474
>
> URL: http://svn.apache.org/viewvc?rev=983474&view=rev
> Log:
> Memcached is often slower than a single file access.

Doesn't that depend on the type of filesystem used and the resources
allocated to memcached?

> Thus, it is not inefficient
> for most FSFS data structures: they can be read in a single request.

I don't understand this.  Does "not inefficient" mean "efficient"?  I
think you mean that for most FSFS data structures it is more efficient
to read from a file than to read from memcached.

> Use the
> membuffer cache for them instead.

I assume this is faster in your test environment.  What sort of
environment is that?  How does it compare to the enviroments that are
currently using memcached?

>
> * subversion/libsvn_fs_fs/caching.c
>   (svn_fs_fs__initialize_caches): replace use of memcached with membuffer 
> cache
>   except for fulltext caches
>
> Modified:
>     subversion/branches/performance/subversion/libsvn_fs_fs/caching.c
>
> Modified: subversion/branches/performance/subversion/libsvn_fs_fs/caching.c
> URL: 
> http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_fs_fs/caching.c?rev=983474&r1=983473&r2=983474&view=diff
> ==============================================================================
> --- subversion/branches/performance/subversion/libsvn_fs_fs/caching.c 
> (original)
> +++ subversion/branches/performance/subversion/libsvn_fs_fs/caching.c Sun Aug 
>  8 19:41:11 2010
> @@ -302,15 +302,15 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
>     * id_private_t + 3 strings for value, and the cache_entry); the
>     * default pool size is 8192, so about a hundred should fit
>     * comfortably. */
> -  if (memcache)
> -    SVN_ERR(svn_cache__create_memcache(&(ffd->rev_root_id_cache),
> -                                       memcache,
> -                                       serialize_id,
> -                                       deserialize_id,
> -                                       sizeof(svn_revnum_t),
> -                                       apr_pstrcat(pool, prefix, "RRI",
> -                                                   NULL),
> -                                       fs->pool));
> +  if (get_global_membuffer_cache())
> +    SVN_ERR(svn_cache__create_membuffer_cache(&(ffd->rev_root_id_cache),
> +                                              get_global_membuffer_cache(),
> +                                              svn_fs_fs__serialize_id,
> +                                              svn_fs_fs__deserialize_id,
> +                                              sizeof(svn_revnum_t),
> +                                              apr_pstrcat(pool, prefix, 
> "RRI",
> +                                                          NULL),
> +                                              fs->pool));
>    else
>      SVN_ERR(svn_cache__create_inprocess(&(ffd->rev_root_id_cache),
>                                          dup_id, sizeof(svn_revnum_t),
> @@ -322,15 +322,15 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
>  
>    /* Rough estimate: revision DAG nodes have size around 320 bytes, so
>     * let's put 16 on a page. */
> -  if (memcache)
> -    SVN_ERR(svn_cache__create_memcache(&(ffd->rev_node_cache),
> -                                       memcache,
> -                                       svn_fs_fs__dag_serialize,
> -                                       svn_fs_fs__dag_deserialize,
> -                                       APR_HASH_KEY_STRING,
> -                                       apr_pstrcat(pool, prefix, "DAG",
> -                                                   NULL),
> -                                       fs->pool));
> +  if (get_global_membuffer_cache())
> +    SVN_ERR(svn_cache__create_membuffer_cache(&(ffd->rev_node_cache),
> +                                              get_global_membuffer_cache(),
> +                                              svn_fs_fs__dag_serialize,
> +                                              svn_fs_fs__dag_deserialize,
> +                                              APR_HASH_KEY_STRING,
> +                                              apr_pstrcat(pool, prefix, 
> "DAG",
> +                                                          NULL),
> +                                              fs->pool));
>    else
>      SVN_ERR(svn_cache__create_inprocess(&(ffd->rev_node_cache),
>                                          svn_fs_fs__dag_dup_for_cache,
> @@ -342,15 +342,15 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
>  
>  
>    /* Very rough estimate: 1K per directory. */
> -  if (memcache)
> -    SVN_ERR(svn_cache__create_memcache(&(ffd->dir_cache),
> -                                       memcache,
> -                                       svn_fs_fs__dir_entries_serialize,
> -                                       svn_fs_fs__dir_entries_deserialize,
> -                                       APR_HASH_KEY_STRING,
> -                                       apr_pstrcat(pool, prefix, "DIR",
> -                                                   NULL),
> -                                       fs->pool));
> +  if (get_global_membuffer_cache())
> +    SVN_ERR(svn_cache__create_membuffer_cache(&(ffd->dir_cache),
> +                                              get_global_membuffer_cache(),
> +                                              
> svn_fs_fs__dir_entries_serialize,
> +                                              
> svn_fs_fs__dir_entries_deserialize,
> +                                              APR_HASH_KEY_STRING,
> +                                              apr_pstrcat(pool, prefix, 
> "DIR",
> +                                                          NULL),
> +                                              fs->pool));
>    else
>      SVN_ERR(svn_cache__create_inprocess(&(ffd->dir_cache),
>                                          dup_dir_listing, APR_HASH_KEY_STRING,
> @@ -362,15 +362,15 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
>  
>    /* Only 16 bytes per entry (a revision number + the corresponding offset).
>       Since we want ~8k pages, that means 512 entries per page. */
> -  if (memcache)
> -    SVN_ERR(svn_cache__create_memcache(&(ffd->packed_offset_cache),
> -                                       memcache,
> -                                       manifest_serialize,
> -                                       manifest_deserialize,
> -                                       sizeof(svn_revnum_t),
> -                                       apr_pstrcat(pool, prefix, 
> "PACK-MANIFEST",
> -                                                   NULL),
> -                                       fs->pool));
> +  if (get_global_membuffer_cache())
> +    SVN_ERR(svn_cache__create_membuffer_cache(&(ffd->packed_offset_cache),
> +                                              get_global_membuffer_cache(),
> +                                              svn_fs_fs__serialize_manifest,
> +                                              
> svn_fs_fs__deserialize_manifest,
> +                                              sizeof(svn_revnum_t),
> +                                              apr_pstrcat(pool, prefix, 
> "PACK-MANIFEST",
> +                                                          NULL),
> +                                              fs->pool));
>    else
>      SVN_ERR(svn_cache__create_inprocess(&(ffd->packed_offset_cache),
>                                          dup_pack_manifest, 
> sizeof(svn_revnum_t),
>
>

-- 
Philip

Reply via email to