Arc Forumnew | comments | leaders | submitlogin
1 point by darjeeling 4512 days ago | link | parent

I managed to run arc-news, thanks to all your help.

After running it, I have a few more questions, I hope you aren't frustrated with me yet :)

1. What is the difference between "racket -m -f" (this one doesn't work, but used to work with mzscheme) and just "racket -f"? The manpage asks to visit the webpage and i went to this page to look for help, but I dont seem to be able to locate it: http://docs.racket-lang.org/guide/racket.html

2. In the arc prompt, after loading "news.arc", I would like to run the news server on a different thread, eg: "(= app (thread (nsv)))" (read on the web), but it doesnt return me the arc prompt.

3. Just to test what happens under increased load, I went to localhost:8080 and repeatedly hit the refresh button on my browser. After many repeated refreshes, the news page was no longer served. Here's what was happening in the arc screen: http://pastebin.com/TcBa2SuM and here's the tail of logs/srv-* file: http://pastebin.com/Xiym77sR (i wonder who the strange user 0PgEaESj is :))

How can I configure arc to continue working under heavy load (maybe by denying requests only from the client that's flooding)?



2 points by akkartik 4512 days ago | link

1. Yes, -m is meaningless in racket (which is why it's not mentioned on that page you linked to). It's one of several incompatible changes with mzscheme.

2. Hmm, it works for me. Are you sure there's no prompt? Here's how it looks for me:

  $ racket -f as.scm  
  Use (quit) or ^D to quit, (tl) to return here after an interrupt. 
  arc> (load "news.arc") 
  nil 
  arc> (thread (nsv)) 
  #<thread> 
  arc> rm: cannot remove `arc/news/story/*.tmp': No such file or directory 
  load items:  
  ranking stories. 
  ready to serve port 8080 
It's hidden, but there's a 'arc> ' prompt after it returns #<thread>. Threads still continue to print to the terminal, so that makes the prompt a little hard to find. In these situations I just type in a new expression (say 'nil') and hit <Enter>. If I get a response, I was at the prompt :)

3. Check out the third bullet at http://sites.google.com/site/arclanguagewiki/arc-3_1/known-b... about srv throttling connections :)

-----

1 point by rocketnia 4512 days ago | link

"-m is meaningless in Racket"

Only if it's meaningless to invoke a procedure called 'main automatically. :-p

These are the command-line args: http://docs.racket-lang.org/reference/running-sa.html

The old -m option appearing in the instructions at arclanguage.org/install meant "don't show the 'Welcome to PLT Scheme' message."

-----

1 point by darjeeling 4512 days ago | link

Yes, you're right, the prompt was being returned- I wasn't careful enough :)

It came as a surprise that HN serves directly off port 80- wonder how to they manage ssl from arc. I plan to serve via apache rewrite rules (reverse proxy)- and yes, sadly all ips in the arc logs show the local address. Thanks for this link. Also, who is that strange user on my logs (there are different names on different hosts)? :)

One OT question: Is there someway I can make comments on a story's page appear sorted by time- let's say- by pressing some button "show oldest/newest first" ? I have not yet started to hack the code- wanted to be a little comfortable with the system first. I assume working with news.arc would be enough for the news page?

-----