Re: [nodejs] Re: MMO game node balancing multi servers

2012-07-05 Thread hd nguyen
OK thanks for your update. @Yi Tan: have you had a chance to take a look at BrowserQuest( http://browserquest.mozilla.org/)? It's impressive MMO game built with nodejs on server side and work in very responsive manner. If I host server code in one server, everything is ok, in the same world, diffe

Re: [nodejs] Re: MMO game node balancing multi servers

2012-07-05 Thread Dominic Tarr
what sort of messages are you sending? if your messages have the right properties, and allow eventual consistency, you should just be able to connect your servers, and it should just work. what you need is for each node (client, server, etc) to end up with the same result eventually, even if thei

Re: [nodejs] node v0.8.1 - higher memory consumption?

2012-07-05 Thread chusi
the --trace-gc-verbose parameter didn't print anything (at least not in the minute i waited) and until i reach the 50 MB (monitoring using --trace-gc) at least some hours have to pass by. I will try it later. here's a pic of running the same code once with node v0.6.17 (chris lea's packet) and

[nodejs] Re: Storing class objects in a session (expressjs)

2012-07-05 Thread ec.developer
Thanks for advices =) I think I'll store in session just the static data, and object that I need to use will create in other place. On Thursday, July 5, 2012 12:35:12 AM UTC+3, ec.developer wrote: > > Hi all, > I'm trying to store a class object in a session (I actually use > ExpressJS). For cl

Re: [nodejs] Re: MMO game node balancing multi servers

2012-07-05 Thread Charles Care
I think you're asking about two things: load balancing and replication of state between instance. These are separate problems. Nginx and http proxy will help you with load balancing and the configuration of sticky sessions etc. This allows you to horizontally scale your front-end servers. However

Re: [nodejs] Re: MMO game node balancing multi servers

2012-07-05 Thread hd nguyen
It's right Charles. And I also understand you and Dominic's idea, I just want to find a tool/module that supports replicating game state between different servers. If such a tool exists, it's very helpful to us than starting from scratch :) On Thu, Jul 5, 2012 at 3:07 PM, Charles Care wrote: >

Re: [nodejs] Re: MMO game node balancing multi servers

2012-07-05 Thread Dan Milon
Your requirement to be able and spin up more servers of the same "game" requires a lot of sharing between each of these servers, because they need (eventually) to be in the same state. The only advantage of this over having a single server for each "game" is that you load balance incoming traff

Re: [nodejs] Re: MMO game node balancing multi servers

2012-07-05 Thread hd nguyen
Thanks Dan, Separating each game on a server is good idea, but when the number of users for that game is big enough, that exceeds server processing ability, so we need to scale out (cannot scale up now, it reaches the limitation of physical machine), and we turn back to initial problem, how to mai

Re: [nodejs] Re: MMO game node balancing multi servers

2012-07-05 Thread Dominic Tarr
hi, I've been doing quite a bit of research into this area recently. there is a lot of interesting stuff, I have a blog post that summarizes some approaches and links to some papers http://dominictarr.com/post/25083602144/distributed-programming-is-easy eventual consistency is not actually that di

Re: [nodejs] Re: Storing class objects in a session (expressjs)

2012-07-05 Thread dolphin 278
You could also inherit your own implementation of session store based on existing one, and alter load method to add your function when session data loads into memory. - Boris Egorov skype/gtalk/nickname: dolphin278 mobile: +7 905 728 1543 On Thu, Jul 5, 2012 at 12:00 PM, ec.developer wrot

Re: [nodejs] Re: MMO game node balancing multi servers

2012-07-05 Thread Adam Reynolds
Hi, Are you looking at this incorrectly? Should you be looking into 'handing off' players between game servers not locking a user to a specific server and expecting game servers to maintain state. Your solution will create an immense amount of traffic between servers and eventually you will flood y

Re: [nodejs] node v0.8.1 - higher memory consumption?

2012-07-05 Thread Vyacheslav Egorov
--trace-gc-verbose should be used together with --trace-gc. When enabled should produce something like: 1087 ms: Scavenge 2.6 (20.4) -> 1.6 (20.4) MB, 0 ms [allocation failure]. Memory allocator, used: 21409792, available: 746147840 New space, used:0, available: 1048576 Ol

[nodejs] Node.js - Rate limit exceeded when consuming friends/ids

2012-07-05 Thread Sara P
I am creating a node.js app that interacts with twitter REST API to get user's information. I cannot get oauth to work as I'm receiving the rate limit warning "Rate limit exceeded. Clients may not make more than 150 requests per hour". But I am able to get the results with response status set

Re: [nodejs] Node.js - Rate limit exceeded when consuming friends/ids

2012-07-05 Thread pushpinder rattan
which module are you using for the GET request? On Thu, Jul 5, 2012 at 4:37 PM, Sara P wrote: > I am creating a node.js app that interacts with twitter REST API to get > user's information. I cannot get oauth to work as I'm receiving the > rate limit warning "Rate limit exceeded. Clients may no

Re: [nodejs] node v0.8.1 - higher memory consumption?

2012-07-05 Thread hasanyasin
Node 0.8 compiled from source without additional parameters with just ./configure on Debian 6 64bit. test-memory-use.js: setInterval(function(){console.log('waiting idle...'); }, 5000); Output of node --trace-gc --trace-gc-verbose test-memory-use.js: (Ran as root to prevent any kind of li

[nodejs] Re: Cannot run node from cron

2012-07-05 Thread Keith M
Thanks for the suggestion, but selinux is not enabled. I wasted 2 days trying to figure out what was going wrong, then the problem went away after rebooting the server, so I'll never know the cause! On Thursday, 5 July 2012 04:35:58 UTC+1, Joe Nall wrote: > > On Wednesday, July 4, 2012 8:54:41

[nodejs] Killing child processes (semi-undocumented feature)

2012-07-05 Thread Gijs Kunze
To isolate potentially crashy code (code that spawns binaries via the child_process module) from a long-running server process I've been spawning a node process which executes the code from the server process which in turn executes all the potentially crashing processes. This way - I figured -

Re: [nodejs] node v0.8.1 - higher memory consumption?

2012-07-05 Thread Vyacheslav Egorov
Well this looks pretty good to me: 1.9 mb used, 36 mb reserved (big chunk is 32 mb for new space, only 2mb should be committed). In total I estimate: 4mb committed for old data/pointer spaces, 1mb for codespace, and 128 kb and 96kb for map and cell spaces respectively (apparently they did not grow

Re: [nodejs] Killing child processes (semi-undocumented feature)

2012-07-05 Thread Ben Noordhuis
On Thu, Jul 5, 2012 at 4:06 PM, Gijs Kunze wrote: > To isolate potentially crashy code (code that spawns binaries via the > child_process module) from a long-running server process I've been spawning > a node process which executes the code from the server process which in turn > executes all the

Re: [nodejs] node v0.8.1 - higher memory consumption?

2012-07-05 Thread hasanyasin
Yeah, it is exactly like that. So I don't share the concerns of original poster; but I just wanted to make sure if that situation is exactly like this. On Thu, Jul 5, 2012 at 10:13 AM, Vyacheslav Egorov wrote: > Well this looks pretty good to me: 1.9 mb used, 36 mb reserved (big > chunk is 32 mb

[nodejs] Re: Node.js - Rate limit exceeded when consuming friends/ids

2012-07-05 Thread Roly Fentanes
Have you tried ntwitter ? It's pretty good for interacting with twitter. On Thursday, July 5, 2012 4:07:04 AM UTC-7, Sara P wrote: > > I am creating a node.js app that interacts with twitter REST API to get > user's information. I cannot get oauth to work as

Re: [nodejs] Installing mysql module - wrong architecture

2012-07-05 Thread Tim Johnson
* Ben Noordhuis [120704 17:11]: > > > > This installation is on mac OSX ver 10.7 (darwin) > > Maybe related to https://github.com/joyent/node/issues/3633 ? Yup. As per the instructions I commented out the lines refered to. As time p

[nodejs] Parallel Async Calls and Parallel Errors

2012-07-05 Thread Alan Gutierrez
Let's say that somewhere within your library, you delete the contents of a directory in parallel. Let's say all the files in a directory are read-only so all your parallel requests return an error. If you've exposed a Node.js style asynchronous function with an `(error, result, result...)` callba

Re: [nodejs] Parallel Async Calls and Parallel Errors

2012-07-05 Thread Dan Milon
I believe a streaming API would be more appropriate for such a task. Something like: var deleter = new Deleter('~'); deleter.on('error', function (err) { console.error(err) }) deleter.on('file', function (fileName) { console.log('deleted ' + fileName) }) deleter.on('end', function () {

[nodejs] Re: Node.js - Rate limit exceeded when consuming friends/ids

2012-07-05 Thread Sara P
Solved the problem. @Roly Fentanes & @pushpinder rattan Thanks a lot guys for your reply. I tried node-oauth, request, ntwitter etc and nothing worked.. Everything was right and the problem is with the twitter app I have created. Something have messed up. I recreated my twitter app and got the

[nodejs] Re: Parallel Async Calls and Parallel Errors

2012-07-05 Thread Jeff Barczewski
It depends on your requirements, but here are some quick thoughts. If you are using callbacks you typically only want to call the callback once so: Many systems just return the first error that occurs and you would be expected to resolve and then retry the operation. If you actually want all t

[nodejs] Re: Parallel Async Calls and Parallel Errors

2012-07-05 Thread hasanyasin
It is best giving as much detailed and correct information about errors to user. Err: Unable to delete blah.txt, quitting. This can be okay; but in case I have 1000 files to delete and I already know some are not possible to delete; but I still want to the tool to go over other files inste

Re: [nodejs] Re: devil's advocate: why would I choose nodejs over MVC + IIS?

2012-07-05 Thread Davis Ford
I've also built a number of projects out on the MS stack. They do offer the Website Spark program http://www.microsoft.com/web/websitespark/ which surprisingly few people know about -- but it is a way to get basically all their tools for free (MS SQL Server, Windows Server 2008, VS, Expression).

Re: [nodejs] devil's advocate: why would I choose nodejs over MVC + IIS?

2012-07-05 Thread Kevin Swiber
On Tue, Jul 3, 2012 at 1:56 PM, Justin Collum wrote: > Had a discussion with a friend about Nodejs the other day. We are both C# > / MVC / ASP.NET devs, with about 10 years experience. He asked me why > someone would choose Nodejs over IIS + MVC . My argument was 1) > performance 2) non-blocki

Re: [nodejs] Re: Parallel Async Calls and Parallel Errors

2012-07-05 Thread Daniel Rinehart
In a case like this where the standard business logic flow of your code allows individual file deletes to fail, I would model the arguments to the callback differently. Have the result object summarize the number of deleted files that failed along with whatever additional detail is needed for the d

[nodejs] tokenize and parse sql where clause

2012-07-05 Thread Alex
I need to parse out where statements for sql in an app so that the fields can be properly mapped to existing database columns and the statement parameterized, etc. Can anyone suggest an existing node module to accomplish this? Basically, if given a string such as: user.name = 'dsdsadadas' and

[nodejs] Re: devil's advocate: why would I choose nodejs over MVC + IIS?

2012-07-05 Thread Alex
I have used c# extensively over the last 8 years and am currently managing a project where we essentially built prototypes in webapi (making heavy use of async) and node. We ultimately decided to move the project to node for the development phase. Some important points we came across: 1) spee

[nodejs] Re: tokenize and parse sql where clause

2012-07-05 Thread mscdex
On Jul 5, 2:28 pm, Alex wrote: > I need to parse out where statements for sql in an app so that the fields > can be properly mapped to existing database columns and the statement > parameterized, etc.  Can anyone suggest an existing node module to > accomplish this?  Basically, if given a string s

Re: [nodejs] tokenize and parse sql where clause

2012-07-05 Thread Alan Gutierrez
On Thu, Jul 05, 2012 at 11:28:25AM -0700, Alex wrote: > I need to parse out where statements for sql in an app so that the fields > can be properly mapped to existing database columns and the statement > parameterized, etc. Can anyone suggest an existing node module to > accomplish this? Basic

[nodejs] XML DOM Libraries

2012-07-05 Thread Alan Gutierrez
I'd like to parse XML and manipulate it on the server using W3C XML DOM, so that the code can be shared with the browser. I've begun working with https://github.com/jindw/xmldom and I'm wondering if anyone has any opinions about the alternatives. I like this library because it is pure JavaScript,

[nodejs] Re: XML DOM Libraries

2012-07-05 Thread MD
I like elementtree and am sure you would love it too. Here is the link: https://github.com/racker/node-elementtree Cheers!! On Thursday, 5 July 2012 23:17:24 UTC+1, Alan Gutierrez wrote: > > I'd like to parse XML and manipulate it on the server using W3C XML DOM, > so that > the code can be s

Re: [nodejs] Re: XML DOM Libraries

2012-07-05 Thread Alan Gutierrez
On Thu, Jul 05, 2012 at 03:29:54PM -0700, MD wrote: > On Thursday, 5 July 2012 23:17:24 UTC+1, Alan Gutierrez wrote: > > > > I'd like to parse XML and manipulate it on the server using W3C XML DOM, so > > that the code can be shared with the browser. > > > > I've begun working with https://github.

[nodejs] Re: tokenize and parse sql where clause

2012-07-05 Thread Alex
Both look very interesting. Thanks! I wound up pulling up https://github.com/pierrec/node-atok and it works like a charm for what I need. On Thursday, July 5, 2012 5:34:02 PM UTC-4, mscdex wrote: > > On Jul 5, 2:28 pm, Alex wrote: > > I need to parse out where statements for sql in an app s

Re: [nodejs] tokenize and parse sql where clause

2012-07-05 Thread Alex
Good to know about Peg.js. Overkill for what I needed here, but definitely looks like an interesting project that I am going to keep tabs on for future parsing/tokenizing needs. Thanks, Alex On Thursday, July 5, 2012 5:35:29 PM UTC-4, Alan Gutierrez wrote: > > On Thu, Jul 05, 2012 at 11:28:25A

[nodejs] Can node server handle large multiple users sending huge data simultaneously

2012-07-05 Thread Ket
It looks like a silly question, but I have to know about this because I am building an app that allow multiple users to stream data anywhere anytime, and Goolgling cannot help me enough. Thanks -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Maili

Re: [nodejs] Can node server handle large multiple users sending huge data simultaneously

2012-07-05 Thread Dominic Tarr
if you are using streams, only a portion of each stream needs to be in memory at a time, so yes! especially, make sure you are streaming buffers, and not strings, because buffers exist outside the V8 heap, so don't suffer V8 unfortunate memory limitations. On Fri, Jul 6, 2012 at 2:42 PM, Ket wro

[nodejs] Re: XML DOM Libraries

2012-07-05 Thread mscdex
On Jul 5, 9:05 pm, Alan Gutierrez wrote: > To clarify. I'm looking for an implementation of W3C XML DOM. Well, I don't think you're going to find much in the way of XML DOM modules that are pure JavaScript, except the ones you already mentioned. The only other one that I know of that is pure Jav

[nodejs] Re: Storing class objects in a session (expressjs)

2012-07-05 Thread tjholowaychuk
this is by-design, you should only really store JSON-able things, you could store more if you're backing with mongo or have some special store written your codec but yeah typically not recommended, there's really little incentive to do that sort of thing anyway On Jul 4, 2:35 pm, "ec.developer" w

[nodejs] Re: XML DOM Libraries

2012-07-05 Thread dhruvbird
If you don't want fancy xpath-style query capabilities, might I suggest Astro's LTX: https://github.com/astro/ltx On Thursday, July 5, 2012 3:17:24 PM UTC-7, Alan Gutierrez wrote: > > I'd like to parse XML and manipulate it on the server using W3C XML DOM, > so that > the code can be shared wit