{"id":661,"date":"2009-09-09T06:16:33","date_gmt":"2009-09-09T13:16:33","guid":{"rendered":"http:\/\/xiehang.com\/blog\/?p=661"},"modified":"2009-09-09T06:16:33","modified_gmt":"2009-09-09T13:16:33","slug":"mysqlmemcached-vs-openldap","status":"publish","type":"post","link":"https:\/\/xiehang.com\/blog\/2009\/09\/09\/mysqlmemcached-vs-openldap\/","title":{"rendered":"mysql+memcached vs. openldap"},"content":{"rendered":"
I’m going to test two types of authentication system, one is what seems to be common in current days which utilizes database and cache, the popular combination is mysql+memcached, and the other is what I recommended to others for authentication system for all the time – LDAP, and surely openldap is the first choice (Fedora DS is not available on other platforms, though seems it’s easier to manage).<\/p>\n
I compose couple of items describing the tests I’m going to take, and I will review this couple of times while I’m doing the setup.<\/p>\n
First, application. I had some assumption based on my past experience, that is:<\/p>\n
\n- 1 authentication (login with right username and password)<\/li>\n
- 10 look up, getting user’s attributes (for showing them on some pages, note that reading these attributes needs to go through couple of tables)<\/li>\n
- 1 edit, such as changing profile<\/li>\n<\/blockquote>\n<\/ul>\n
\n
- Bad user<\/li>\n
\n- 1 authentication (login with incorrect username or password)<\/li>\n<\/blockquote>\n<\/ul>\n
and the ratio of good vs. bad user is 1:5 (yea, lots of abuse …).<\/p>\n
There will be 1M registered users, but the “good user” will only include 100K of them, which reflects 10% active users rate, actually this is already high. There will be 3 PHP pages: login.php to do authentication, pref.php retrieve preferences of the user, and edit.php try to change user’s profile. All these take GET query strings so to make test easier.<\/p>\n
Environment:<\/p>\n
\n
- database testing environment<\/li>\n
\n- debian acts as web server, running apache and PHP<\/li>\n
- freebsd acts as client, generating load with apache’s ab<\/li>\n
- centos is mysql’s master, handling both read and write<\/li>\n
- opensuse is mysql’s slave, handling read only, note that we are not using mysql-proxy as it seems to me it is far away from production quality so far<\/li>\n
- ubuntu and fedora run memcached, in TCP mode with 64M cache memory each<\/li>\n
- I’m going to post database schema later on<\/li>\n<\/blockquote>\n
- ldap testing environment<\/li>\n
\n- debian acts as web server, running apache and PHP<\/li>\n
- freebsd acts as client, generating load with apache’s ab<\/li>\n
- ubuntu and fedora are running openldap in mirror mode<\/li>\n
- again, schema will be posted here later on<\/li>\n<\/blockquote>\n<\/ul>\n
maybe the only unreal part above is openldap will run in mirror mode, which is not extensible – I will check to see what kind of openldap replication is suitable for production deployment.<\/p>\n
Pretty much that’s it, will update once I review this plan.<\/p>\n","protected":false},"excerpt":{"rendered":"
I’m going to test two types of authentication system, one is what seems to be common in current days which utilizes database and cache, the popular combination is mysql+memcached, and the other is what I recommended to others for authentication system for all the time – LDAP, and surely openldap is the first choice (Fedora […]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[130,128,129,103],"_links":{"self":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts\/661"}],"collection":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/comments?post=661"}],"version-history":[{"count":1,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts\/661\/revisions"}],"predecessor-version":[{"id":662,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts\/661\/revisions\/662"}],"wp:attachment":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/media?parent=661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/categories?post=661"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/tags?post=661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}