anarki icon indicating copy to clipboard operation
anarki copied to clipboard

Error messages under heavy load

Open fauria opened this issue 9 years ago • 17 comments

Under heavy load, I get the following output repeatedly:

...
char-whitespace?: contract violation
  expected: char?
  given: #<eof>
  context...:
   /anarki/ac.scm:1262:4
   /anarki/ac.scm:1279:0: aload1

char-whitespace?: contract violation
  expected: char?
  given: #<eof>
  context...:
   /anarki/ac.scm:1247:0: trash-whitespace
   /anarki/ac.scm:1262:4
   /anarki/ac.scm:1279:0: aload1
...

Is there any way to run this non-interactively?

fauria avatar Nov 23 '16 14:11 fauria

Those errors mean that users are closing the browser connection before it has a chance to return all of the response. Under load Arc takes longer and longer to return a response.

akkartik avatar Nov 23 '16 15:11 akkartik

Any advise on how to tune it to get the most out of it?

fauria avatar Nov 23 '16 16:11 fauria

I'm afraid not.. How many concurrent connections are you seeing?

I assume you're running Anarki?

akkartik avatar Nov 23 '16 16:11 akkartik

Yes, im running Anarki from a Docker container (see #41).

With less than 100 concurrent users per second crashes on a $10 Digital Ocean droplet.

fauria avatar Nov 23 '16 17:11 fauria

I see this same issue immediately after launching @fauria's container with no user access

dholt avatar Mar 02 '17 14:03 dholt

@dholt could you pastebin the container logs?

fauria avatar Mar 02 '17 20:03 fauria

This is all I get; the error block is repeated in an infinite loop enough to peg the CPU core:

load items:
ready to serve port 8080

char-whitespace?: contract violation
  expected: char?
  given: #<eof>
  context...:
   /anarki/ac.scm:1277:4
   /anarki/ac.scm:1294:0: aload1

char-whitespace?: contract violation
  expected: char?
  given: #<eof>
  context...:
   /anarki/ac.scm:1262:0: trash-whitespace
   /anarki/ac.scm:1277:4
   /anarki/ac.scm:1294:0: aload1

dholt avatar Mar 02 '17 22:03 dholt

Could you please provide the command line used to launch the container? There are a few sed replacements along the entry point script that might be causing the issue.

fauria avatar Mar 03 '17 09:03 fauria

I'm launching via Ansible:

---

- name: hackernews | launch container
  docker:
    name: "hackernews"
    hostname: "example.com"
    image: "fauria/hn"
    state: reloaded
    restart_policy: always
    ports:
      - "80:8080"
    volumes:
      - "/mnt/hackernews/static:/anarki/static"
      - "/mnt/hackernews/www:/anarki/www"
    env:
      SITE_NAME: "Example Hacker News"
      SITE_DESCRIPTION: "Example Hacker News"
      SITE_URL: "http://example.com"
      PARENT_URL: "http://example.com"
      ADMIN_USER: "dholt"
      RGB_COLOR: "76b900"
  tags:
    - container

dholt avatar Mar 03 '17 12:03 dholt

Does news.arc actually crash, or is it just displaying some error messages?

hjek avatar Nov 04 '17 22:11 hjek

You're right, it's just displaying error messages.

akkartik avatar Nov 04 '17 22:11 akkartik

Perhaps the errors from a browser closing a connection, could be changed to look a bit less panicky.

hjek avatar Dec 19 '17 17:12 hjek

That seems like a great idea.

akkartik avatar Dec 19 '17 17:12 akkartik

Maybe this fix is ok?

hjek avatar Dec 23 '17 22:12 hjek

Definitely an improvement!

akkartik avatar Dec 23 '17 22:12 akkartik

Turns out it might be a bit to wide ranging. It just catches any error that could cause the connection to terminate, so it could also hide useful information. I need to look at it a bit more.

hjek avatar Dec 23 '17 23:12 hjek

Ah, interesting.

akkartik avatar Dec 23 '17 23:12 akkartik