r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!Cheyenne] Discussions about the Cheyenne Web Server

Dockimbel
19-Dec-2010
[9410]
Graham, if you're concerned about performances and scalability, I 
don't understand why you're considering a CGI-based solution? AFAICT, 
Cheyenne/RSP is the most scalable solution for running REBOL code 
on server-side. If a single Cheyenne instance is not enough, you 
can use a nginx front-end to server static content and dispatch the 
load over several Cheyenne instances.


Our biggest online web-app has ~800 users, with several hundreds 
logging in each day, accessing a 400MB RDBMS with millions of records 
served by a single Cheyenne instance, with 8 workers (each taking 
15 to 25MB of RAM) running on a 2.2Ghz DualCore CPU with 2GB of RAM. 
Average Cheyenne load is 2 req/s with peaks up to 100 req/s (usually 
caused by web scanners or attacks). The webapp is still performing 
well under these conditions, and we have plenty of space to improve 
performances when it will be required (with faster hw and more instances).


Also, a key factor is optimizing webapp's code, especially for the 
most used RSP pages. Btw, a profiler would be a good addition to 
Cheyenne/RSP framework.
Kaj
19-Dec-2010
[9411]
Cool
nve
19-Dec-2010
[9412]
Great, I was sure that Cheyenne can do it !
GrahamC
19-Dec-2010
[9413x2]
Doc, it wasn't me .. it was these other guys who wanted to use this 
thing I'm writing where they don't have the option of installing 
Cheyenne.
They also asked me to port to python and php ... lol
Kaj
20-Dec-2010
[9415]
One version in Python and one version in PHP?
GrahamC
20-Dec-2010
[9416]
I guess so ...
GrahamC
29-Dec-2010
[9417x2]
Given this JS

					if ( bValid ) {

       var dataString = 'pain=' + pain + '&ptgl=' + gs + '&fn=' + fn + '&rapid3=' 
       + rapid3 + '&fatigue=' + fatigue + '&ros=' + ros + '&ems=' + ems 
       + '&patient=' + '<%=patient%>' ;
						//alert (dataString);return false;
						$.ajax({
							type: "POST",
							url: "add-rapid3.rsp",
							data: dataString,
							success: function() {
							 	// removed ...
							}
						});
						return false;
  
						//$( this ).dialog( "close" );
					}
				},

what would cause this?


28/12-23:58:37.055-[DEBUG] c: [pain "[object Object]" ptgl "[object 
Object]" fn "[object Object]" rapid3 "[object Object]" fatigue "[object 
Object]" ros "[object HTMLInputElement]" ems "[object Object]" patient 
"7"]

where the add-rapid3.rsp is

<%
	; add-rapid3.rsp
	c: request/content
	?? c
	exit
%>
guess my javascript is screwed somewhere ...
PeterWood
29-Dec-2010
[9419x3]
This is a result of not overriding the default toString() method 
in your pain, gs, fn, rapid3, fatigue, ros and ems objects.
..but I'm surprised that they are trying to use objects in such a 
way.
they -> you
GrahamC
29-Dec-2010
[9422]
I'm just copying code from JS samples :(
PeterWood
29-Dec-2010
[9423x2]
If you can send me the sample, I'll try to take a look for you later 
on.
... or your full code...
GrahamC
29-Dec-2010
[9425x7]
ahh.. .changing this to  pain.val() works
Thanks for the clue
this is frustrating ...
This is my target script add-rapid3.rsp

<%

context [
	d: now
	; convert to gmt, and then to NZ time
	d: d - d/zone + localzone
	?? d
	; add-rapid3.rsp
	c: request/content

 ; c: [pain "3" ptgl "4" fn "2" rapid3 "5" fatigue "9" ros "6" ems 
 "7" patient "7"]
	?? c
	patient: select c 'patient
	pain: min 10 to-decimal select c 'pain
	fn: min 10 to-decimal select c 'fn
	ptgl: min 10 to-decimal select c 'ptgl
	ros: min 60 to-decimal select c 'ros
	fatigue: min 10 to-decimal select c 'fatigue
	ems: min 360 to-integer select c 'ems
	
	result: make object! [
		patient: (patient)
		pain: (pain)
		fn: (fn)
		ptgl: (ptgl)
		ros: (ros)
		fatigue: (fatigue)
		ems: (ems)
	]
	?? result
]	
	
%>

and the c is the dump from ??
and I'm getting this error in trace.log 


9/12-01:14:18.696-[DEBUG] c: [pain "9" ptgl "8" fn "10" rapid3 "7" 
fatigue "4" ros "6" ems "5" patient "7"]
29/12-01:14:18.696-[RSP] ##RSP Script Error: 

	URL  = /md/add-rapid3.rsp
	File = /r/pwp/www/md/add-rapid3.rsp

	** Script Error : patient has no value 
	** Where: context 
	** Near:  [patient]
crap .. need a compose
the only reason I created the object is that if I used 5 ?? consecutively, 
I get no output after the 4th ?? ... bizarred
Kaj
29-Dec-2010
[9432]
Can you please do this in the JavaScript group?
MikeL
3-Jan-2011
[9433]
In the "I hope this group thinks there are no stupid questions" mode, 
if I get new View 2.7.8.3.1 from 1-Jan-2011, how do I run that with 
Cheyenne?  I tried an .rsp with Funct and it flunks.  So my Cheyenne 
version (a win exe) is not using new R2.
BrianH
3-Jan-2011
[9434]
2.7.7 has FUNCT too, so what you have is a 2.7.6 build.
GrahamC
3-Jan-2011
[9435x3]
doc is not using an encapper higher than 2.7.6
So, you need to run the source code versions of Cheyenne
Or, you can include the r2/forward package in your RSP pages
BrianH
3-Jan-2011
[9438]
Since many of the 2.7.8 native fixes were done for Doc, perhaps he 
will do new encaps.
Dockimbel
3-Jan-2011
[9439x2]
I haven't used 2.7.7 due to a few issues that made it look less stable 
than 2.7.6. I can't afford to use a new version with regressions. 
Hopefully, SDK 2.7.8 looks more polished and it runs Cheyenne flawlessly 
on Linux platform. If the Windows SDK is ok too, I'll upgrade my 
Cheyenne build chain to 2.7.8.
MikeL: 

- Download Cheyenne revision 122 source package from here: http://cheyenne-server.org/download.shtml
- Open a 2.7.8 console
- Type: 
>> cd %<path-to-cheyenne-folder>
>> do %cheyenne.r
MikeL
3-Jan-2011
[9441]
Thanks I had tried that combination a little earlier and after running 
in Windows Auth mode, I get  "Can not open server Rconsole on port 
9801" and "Can not open server Logger on port 9802" as Uniserve errors.
GrahamC
3-Jan-2011
[9442x2]
and are those ports already open?
Does Rebol need to be run as admin?  Is your firewall blocking these 
ports?
MikeL
4-Jan-2011
[9444]
Thanks Graham.   For some corporate machine, changing the firewall 
settings won't be an option.  I ran R2 as admin and gave R2 access 
to everything.  No change.  9801 and 9802 are not recorded as blocked 
for any programs on McAfee inbound or outbound events.
Oldes
4-Jan-2011
[9445x2]
Cheyenne is working fine from sources with 2.7.8 (XP)... Check what 
is using the port.

You can use for example PortQry util: http://support.microsoft.com/kb/832919
Which can show you something like that: 
...
Process ID: 1376 (rebol-view-278-3-1.exe)

Process doesn't appear to be a service

PID	Port		Local IP	State		 Remote IP:Port
1376	TCP 8080  	0.0.0.0 	LISTENING	 0.0.0.0:22712
1376	TCP 9799  	0.0.0.0 	LISTENING	 0.0.0.0:41163
1376	TCP 9801  	0.0.0.0 	LISTENING	 0.0.0.0:43253
1376	TCP 9802  	0.0.0.0 	LISTENING	 0.0.0.0:22573
1376	TCP 9803  	0.0.0.0 	LISTENING	 0.0.0.0:40994
1376	TCP 9799  	127.0.0.1 	ESTABLISHED	 127.0.0.1:1116
1376	TCP 9799  	127.0.0.1 	ESTABLISHED	 127.0.0.1:1117
1376	TCP 9799  	127.0.0.1 	ESTABLISHED	 127.0.0.1:1118
1376	TCP 9799  	127.0.0.1 	ESTABLISHED	 127.0.0.1:1119
This tools is maybe better http://technet.microsoft.com/en-us/sysinternals/bb897437
as it has gui as well
Cyphre
4-Jan-2011
[9447]
You don't need any special tool for port checking in winXP...just 
use the console NETSTAT command.
MikeL
4-Jan-2011
[9448]
Thanks. I am run Windows 7 and ran NetStat as Admin.  Some 9799 and 
other ports in use but no 9801 and 9802.  Trying  TcpView.
Oldes
4-Jan-2011
[9449]
Netstat does not display which process is using the port, does it?
Cyphre
4-Jan-2011
[9450]
Oldes, use netstat /? to get all the options...I guess -o is what 
you need.
Oldes
4-Jan-2011
[9451]
I don't need it:) btw... it's -b
MikeL
4-Jan-2011
[9452]
Thanks for the help.  R2 is listening on 9801 and 9802 now.   Next 
step is to get it to server a page.
Dockimbel
4-Jan-2011
[9453]
Since many of the 2.7.8 native fixes were done for Doc...

 Brian, where can I see this list of fixes? I guess on RAMBO, but 
 it's down since yesterday...
GrahamC
4-Jan-2011
[9454]
It says you collaborated with Carl :)
BrianH
4-Jan-2011
[9455]
I don't know what he did to make Cheyenne better, except ACCESS-OS. 
There were other native fixes to Linux builds mentioned, but I can't 
test on anything other than XP at the moment so I didn't ask for 
a full list. Given the "coordinated with DocKimbel" comment I figured 
you knew better, but that might just be the ACCESS-OS thing, which 
currently does nothing on Windows, and doesn't require an SDK. We'll 
know when the changes doc is updated.
Kaj
4-Jan-2011
[9456]
The fixes that I expect would be Library Component included in Core, 
and View being able to start without X11 running
BrianH
4-Jan-2011
[9457]
I wouldn't expect the latter, as most of what makes View different 
from Core depends on X11. Some image support might be possible in 
Core though. Agreed on the former: If /Library is free, /Pro should 
be free too.
Kaj
4-Jan-2011
[9458]
It was in the planning since a year
BrianH
4-Jan-2011
[9459]
Well, if Carl says it's possible then it is.