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

Add patch for NFS compatibility #149

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rmontagne
Copy link

Hello,

I add a patch to make compatibility of raintpl3 with NFS.

Thanks.

@kargnas
Copy link
Contributor

kargnas commented May 13, 2014

I don't understand why use like this way.

@rmontagne
Copy link
Author

I use this method because NFS share doesn't allow php function flock, so i copy the item that i have needed on the tmp directory. I use this solution on production server, and it works great.

@rmontagne
Copy link
Author

With your solution i must move all my TPL on the /tmp/ dir ? And i have multiple front which use the same file, and the file architecture is the same. I can’t move the tpl off all my front to the tmp dir because if i upgrade one tpl, i must upgrade all my fronts.

Do you understand my configuration ?

Romain Supvize
Envoyé avec Sparrow (http://www.sparrowmailapp.com/?sig)

Le mardi 13 mai 2014 à 08:48, Sang rak, Choi a écrit :

You don't need to do like this.
This will works as your purpose:
\Rain\Tpl::configure('tpl_dir', '/tmp');

or
\Rain\Tpl::configure(array( 'tpl_dir' => '/tmp', //'your_own_configs' => 'your_own_configs' ));


Reply to this email directly or view it on GitHub (#149 (comment)).

@kargnas
Copy link
Contributor

kargnas commented May 13, 2014

This will make huge load for system for production sever. (Always compile again for all page loading! It is same as debug mode) Cannot be used for production. Find other way..

Anyway, the option name nfs is bad name for this code.

@kargnas
Copy link
Contributor

kargnas commented May 13, 2014

@rmontagne Sorry, I did misunderstand. I deleted that reply and I post new reply just seconds ago.

@kargnas
Copy link
Contributor

kargnas commented May 13, 2014

I suggest symbolic link:

$ ln -s /data/mynfs/templates /tmp/template
\Rain\Tpl::configure('tpl_dir', '/tmp/template');

@rmontagne
Copy link
Author

no problem, In my configuration, the template compile just one times and it store on a memcached server, but if you have another solution compliance with nfs share it's so good. I think you must try a multiple front configuration with nfs yourself.

@kargnas
Copy link
Contributor

kargnas commented May 13, 2014

I am using raintpl for 5+ php app servers using git repository.
I think, NFS is not good as use of source files. NFS is good for unpredictable changes file system like photos by user uploading.

@rmontagne
Copy link
Author

So when you make a change on you source code, you must git pull on all off your master ?

@rmontagne
Copy link
Author

With a symbolic link, the php flock function return false, so the template engine doesn't compile my template ...

@kargnas
Copy link
Contributor

kargnas commented May 13, 2014

Sure. I have seperated directory for development in main develop server. Also it has own domain. (http://dev.myservice.com)

I make shell script for deployment. Also there are many deployment tools for deployment like Phing.

@rmontagne
Copy link
Author

So you must connect on each your front to launch your script or add your ssh key on your deployment server to run this script, i think i keep my solution because it more simple, I just upgrade nfs files and all my front are updated.

Thanks for your help.

@kargnas
Copy link
Contributor

kargnas commented May 13, 2014

Yes, this is so uncomfortable.

So i found my own way for convenience,

For development, I just always upload files to linked sftp in my IDE. (this maybe same as you) Then test many times in my development site.

And I will commit If I am sure about all changes of sources. And then, run deployment script to pull sources. I usually deploy about 4~10 times in a day.

@rmontagne
Copy link
Author

And if you have a problem, you have a script for rollback on all of your front servers ? I think both solutions works great.

@kargnas
Copy link
Contributor

kargnas commented May 13, 2014

No have for rollback, just rollback source using git, then commit again. then deploy.

But my way is so slow for emergency situation.

@rmontagne
Copy link
Author

ok, i understand you configuration, but now for me it must simple to use NFS, the template are generate and store an memcached server, and the performance isn't impact. But for the future, I will think to a deployement system like yours.

@kargnas
Copy link
Contributor

kargnas commented May 13, 2014

Yes. That is good with memcached or other caching system.

@sitthykun
Copy link

I suggest redis for caching system

On Tue, May 13, 2014 at 2:52 PM, Sang rak, Choi notifications@github.comwrote:

Yes. That is good with memcached or other caching system.


Reply to this email directly or view it on GitHubhttps://github.com//pull/149#issuecomment-42926870
.

Sitthykun LY
a little developer in the big world \o/
mobile: +85595 7788 39
skype: cityx9
twitter: sitthykun http://twitter.com/sitthykun
site: niyum.com

@rmontagne
Copy link
Author

Why not, I never tried this system.

@sitthykun
Copy link

It is monster cached system and super fast, it generate key by nanosecond
I think you will fall in love.
I am thinking like your moment above for this

here http://redis.io/topics/quickstart

On Tue, May 13, 2014 at 3:01 PM, rmontagne notifications@github.com wrote:

Why not, I never tried this system.


Reply to this email directly or view it on GitHubhttps://github.com//pull/149#issuecomment-42927511
.

Sitthykun LY
a little developer in the big world \o/
mobile: +85595 7788 39
skype: cityx9
twitter: sitthykun http://twitter.com/sitthykun
site: niyum.com

@rmontagne
Copy link
Author

Thanks , I use this lib to manage my cache : http://maximebf.github.io/CacheCache/ and it compliance with redis, good news for me, when i have time i try to setup a redis server inside of my memcached server, have you a benchmark between both system ?

@kargnas
Copy link
Contributor

kargnas commented May 13, 2014

I had been use apc/redis/memcached.
APC -> Memcached > Redis -> Redis + Back to APC

Memcached / Redis use much system resource. (Socket I/O) I am just using Redis for shared cached data. Others used in APC.

@sitthykun
Copy link

Here is benchmark of this comparison, sorry I forgot the live comparison

http://anton.logvinenko.name/en/blog/redis-vs-memcache-vs-memcached.html

My experience I used to develop LiveChat with memcached then I got suffer.
I desired to use redis due to redis has monitoring.
it's fast; can export data, log and data accuracy.

On Tue, May 13, 2014 at 4:35 PM, Sang rak, Choi notifications@github.comwrote:

I had been use apc/redis/memcached.
APC -> Memcached > Redis -> Redis + Back to APC

Memcached / Redis has many system resource. (Socket I/O) I am using Redis
for shared cached data. Others used in APC.


Reply to this email directly or view it on GitHubhttps://github.com//pull/149#issuecomment-42935069
.

Sitthykun LY
a little developer in the big world \o/
mobile: +85595 7788 39
skype: cityx9
twitter: sitthykun http://twitter.com/sitthykun
site: niyum.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants