免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 7043 | 回复: 17
打印 上一主题 下一主题

[性能 SESSION] 多服务器器共享session的方案 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-06-13 16:01 |只看该作者 |倒序浏览
现在的社区要有10w人访问。。这样一台服务器肯定挂掉。那么就会架设多台服务器。那这样就会有session共享的问题。请教各位大哥大姐,应该如何解决这个问题?请给出详细的实现步骤.. 谢谢大哥大姐

[ 本帖最后由 HonestQiao 于 2006-6-13 16:33 编辑 ]

论坛徽章:
62
2016科比退役纪念章
日期:2016-06-28 17:45:06奥兰多魔术
日期:2015-05-04 22:47:40菠菜神灯
日期:2015-05-04 22:35:07菠菜神灯
日期:2015-05-04 22:35:02NBA季后赛大富翁
日期:2015-05-04 22:33:34NBA常规赛纪念章
日期:2015-05-04 22:32:032015年亚洲杯纪念徽章
日期:2015-04-14 16:54:452015年亚洲杯之朝鲜
日期:2015-03-19 23:03:16明尼苏达森林狼
日期:2015-03-16 21:51:152015小元宵徽章
日期:2015-03-06 15:57:202015年迎新春徽章
日期:2015-03-04 09:55:282015年辞旧岁徽章
日期:2015-03-03 16:54:15
2 [报告]
发表于 2006-06-13 16:23 |只看该作者
nfs, 数据库,cookie

还真没听说过10w的社区

论坛徽章:
1
技术图书徽章
日期:2013-12-05 23:25:45
3 [报告]
发表于 2006-06-13 16:33 |只看该作者
推荐memcached,确是很好,可以大到利用几百台机子的内存做为缓存。

论坛徽章:
0
4 [报告]
发表于 2006-06-13 16:52 |只看该作者
你可以参考这篇文章。 把其中的数据库换成memcache的话。效率就会大大增加。
http://nio.infor96.com/sharing-php-session-data-between-servers/

论坛徽章:
0
5 [报告]
发表于 2006-06-13 17:09 |只看该作者
原帖由 HonestQiao 于 2006-6-13 16:33 发表
推荐memcached,确是很好,可以大到利用几百台机子的内存做为缓存。


哥哥,能给个详细点说明嘛

论坛徽章:
62
2016科比退役纪念章
日期:2016-06-28 17:45:06奥兰多魔术
日期:2015-05-04 22:47:40菠菜神灯
日期:2015-05-04 22:35:07菠菜神灯
日期:2015-05-04 22:35:02NBA季后赛大富翁
日期:2015-05-04 22:33:34NBA常规赛纪念章
日期:2015-05-04 22:32:032015年亚洲杯纪念徽章
日期:2015-04-14 16:54:452015年亚洲杯之朝鲜
日期:2015-03-19 23:03:16明尼苏达森林狼
日期:2015-03-16 21:51:152015小元宵徽章
日期:2015-03-06 15:57:202015年迎新春徽章
日期:2015-03-04 09:55:282015年辞旧岁徽章
日期:2015-03-03 16:54:15
6 [报告]
发表于 2006-06-13 17:15 |只看该作者
缓存和session没关系吧

论坛徽章:
1
技术图书徽章
日期:2013-12-05 23:25:45
7 [报告]
发表于 2006-06-13 23:05 |只看该作者
原帖由 pspman 于 2006-6-13 17:09 发表


哥哥,能给个详细点说明嘛



这个是一个综合应用。

http://weirdsilence.net/software/memsession/

WS Memcached Session Handler for PHP
Normal PHP sessions that are valid across multiple servers, can usually be done by using a database. But utilizing MemCached you get a real speed boost!
Our MemCachedClient for PHP uses the same interface as the one linked at the official API page, our session handler is tested with that client too. But we thought that their client would be overkill for our purpose; therefore we created our own.
NOTE
If you're using this software, we would like to know! We're thinking of compiling a list of links to projects that use it - So if you would like to be listed, drop us a mail! A mail link is at the bottom!
Usage
View the example.php file for usage, it really is that simple...
Configuration
In the session handler (weirdsession.inc.php) in the top you can change the MemCached server ip and port and if you want to use zlib compression.
  1. $__options = array(
  2. 'servers' => array(
  3. '127.0.0.1:11211'
  4. ),
  5. 'debug' => false,
  6. 'compress' => false
  7. );
复制代码
For future release

    * MemCached client: dead server check support.
    * MemCached client: Batch key fetch (multiple in one query)

Downloads

    * WS-SesHandler-0.02.tar.gz - Version 00.2 (incl. Own MemCached Client) (9 KB)
    * WS-MCClient-0.01.tar.gz - Own MemCachedClient only (8 KB)

Real world usage

    * Played.dk

Links to resources

    * PHP
    * PHP - set_session_handler
    * MemCached
    * MemCached - Client API's

Send us mail!

论坛徽章:
0
8 [报告]
发表于 2006-06-15 10:27 |只看该作者
原帖由 HonestQiao 于 2006-6-13 23:05 发表



这个是一个综合应用。

http://weirdsilence.net/software/memsession/

WS Memcached Session Handler for PHP
Normal PHP sessions that are valid across multiple servers, can usually be done b ...



这个方案中,等于是自己重写了一遍对Memcached Server的控制函数,同时使用了自定义的一套session存取定义机制
为什么不使用PHP已经支持的已有函数呢??

除非server本身没有安装对Memcached Server的模板extend 支持

论坛徽章:
0
9 [报告]
发表于 2006-06-15 10:33 |只看该作者
原帖由 七星剑客 于 2006-6-13 16:52 发表
你可以参考这篇文章。 把其中的数据库换成memcache的话。效率就会大大增加。
http://nio.infor96.com/sharing-php-session-data-between-servers/



楼主这个IDEA非常棒啊,这个文章的作者其实最后已经提到了类似memcached server 这样的概念

论坛徽章:
0
10 [报告]
发表于 2006-06-15 12:04 |只看该作者
回算贴子了~
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP