Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memcache route collections #13309

Closed
wants to merge 1 commit into from
Closed

Memcache route collections #13309

wants to merge 1 commit into from

Conversation

RobinMcCorkell
Copy link
Member

Only works for serializable objects, which do not contain closures (anonymous functions). Kill actionInclude() and anonymous functions in route files!

Confirmed working for:

  • ocs
  • files_external
  • user_ldap

Doesn't work for:

  • root (core)
  • files
  • files_sharing
  • files_versions

cc @DeepDiver1975 @Raydiation @MorrisJobke

Only works for serializable objects, which do not contain closures (anonymous
functions). Kill `actionInclude()` and anonymous functions in route files!

Confirmed working for:
 - ocs
 - files_external
 - user_ldap

Doesn't work for:
 - root (core)
 - files
 - files_sharing
 - files_versions
@LukasReschke
Copy link
Member

I'd vote for #13227 before adding this

@scrutinizer-notifier
Copy link

The inspection completed: 6 new issues, 3 updated code elements

@ghost
Copy link

ghost commented Jan 13, 2015

Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/6540/
👍 Test PASSed. 👍

@RobinMcCorkell
Copy link
Member Author

Test code:

<?php
session_write_close();
require_once('./lib/base.php');

$cache = new \OC\Memcache\APCu('router');
//$cache = new \OC\Memcache\Null('router');

$router = new \OC\Route\CachingRouter($cache);
for ($i = 0; $i < 1000; ++$i) {
    $router->loadedApps = array();
    $router->collections = array();
    $router->loadCollection('ocs', 'ocs/routes.php');
}

Change the Memcache backend as necessary for different metrics. I had to gut the Router class a bit to allow access to protected and private members and functions, and to overrride an include_once. Below, 1 is using the Null backend, 2 is using the APCu backend:

graph

graph2

graph3

@RobinMcCorkell
Copy link
Member Author

Hmm, this approach doesn't work. Calls to OC_API::register register things in the API handler, not just create routes, so not loading ocs/routes.php means that OCS API calls break. It seems that the only way it's going to work is by caching the individual routes as they are created in the router, since those bits appear to be static.

@RobinMcCorkell RobinMcCorkell deleted the routing_memcache branch January 13, 2015 13:07
@lock lock bot locked as resolved and limited conversation to collaborators Aug 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants