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

GrahamC
18-Dec-2010
[9388x2]
So, I guess the next question is .. how does one determine if the 
server is overloaded?
read the logs and ??
Kaj
18-Dec-2010
[9390x2]
Your customers will be on the phone yelling at you :-)
If it's a Unix box, you use tools such as uptime, top and htop
GrahamC
18-Dec-2010
[9392x4]
Windows 2003 server on Ec2
I gave them my cellphone so they can pay the charges for yelling 
at me!
heh... the freemed guy was asking if I can rewrite my drug interaction 
portal in php and python!
Hmm... can Magic on Apache run similar RSP code as Cheyenne ?  Wonder 
how hard it would be to port from Cheyenne to Magic
Kaj
18-Dec-2010
[9396]
Magic!'s concept is the reverse of RSP
GrahamC
18-Dec-2010
[9397x2]
reverse?
I've never used it ... just know it exists
nve
18-Dec-2010
[9399x2]
Dockimbel can give you advices.
There's QM from ChrisRG but not sure it reached a official release.
GrahamC
18-Dec-2010
[9401x4]
True and that uses Apache
This is the app I'm working on to deploy nationwide ( small nation 
though :) ) https://nzra.cloud-ehr.net/
There's a Guest account
Now if a certain big pharma company goes ahead to pay for this as 
they have said .. I'll put "powered by Rebol" banners everywhere 
:)
nve
18-Dec-2010
[9405]
And Powered by Cheyenne banner !
GrahamC
18-Dec-2010
[9406]
that's already ther e...
nve
18-Dec-2010
[9407x2]
everywhere !
;-)
Kaj
18-Dec-2010
[9409]
RSP is a template system. Magic! generates pages from REBOL dialects
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