Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
node-http-proxy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
node-http-proxy
Commits
dd1918dc
Commit
dd1918dc
authored
Sep 17, 2010
by
indexzero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[debug] Better debug messages to try to determine if pool is slowly losing clients to forever busy
parent
7c2eb5de
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
lib/node-http-proxy.js
lib/node-http-proxy.js
+2
-2
vendor/pool/main.js
vendor/pool/main.js
+9
-0
No files found.
lib/node-http-proxy.js
View file @
dd1918dc
...
...
@@ -30,7 +30,7 @@ var sys = require('sys'),
pool
=
require
(
'
./../vendor/pool/main
'
),
eyes
=
require
(
'
eyes
'
),
min
=
0
,
max
=
10
0
;
max
=
10
;
// Setup the PoolManager
var
manager
=
pool
.
createPoolManager
();
...
...
@@ -146,7 +146,7 @@ HttpProxy.prototype = {
// Open new HTTP request to internal resource with will act as a reverse proxy pass
var
p
=
manager
.
getPool
(
port
,
server
);
sys
.
puts
(
'
current pool count for
'
+
req
.
headers
.
host
+
"
:
"
+
port
+
'
'
+
p
.
clients
.
length
);
sys
.
puts
(
'
Current pool count for
'
+
req
.
headers
.
host
+
"
:
"
+
port
+
'
'
+
p
.
clients
.
length
+
'
, Busy:
'
+
p
.
getBusy
()
+
'
, Free:
'
+
p
.
getFree
()
);
p
.
on
(
'
error
'
,
function
(
err
)
{
// Remark: We should probably do something here
...
...
vendor/pool/main.js
View file @
dd1918dc
...
...
@@ -84,6 +84,14 @@ Pool.prototype.onFree = function (client) {
if
(
this
.
pending
.
length
>
0
)
this
.
pending
.
shift
()(
client
);
};
Pool
.
prototype
.
getFree
=
function
()
{
return
this
.
clients
.
filter
(
function
(
client
)
{
return
!
client
.
busy
}).
length
;
};
Pool
.
prototype
.
getBusy
=
function
()
{
return
this
.
clients
.
filter
(
function
(
client
)
{
return
client
.
busy
}).
length
;
};
Pool
.
prototype
.
setMinClients
=
function
(
num
)
{
this
.
minClients
=
num
;
if
(
this
.
clients
.
length
<
num
)
{
...
...
@@ -98,6 +106,7 @@ Pool.prototype.setMinClients = function (num) {
Pool
.
prototype
.
setMaxClients
=
function
(
num
)
{
this
.
maxClients
=
num
;
};
Pool
.
prototype
.
end
=
function
()
{
this
.
clients
.
forEach
(
function
(
c
)
{
c
.
end
()});
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment