Quantcast
Channel: Discourse Meta - Latest topics
Viewing all 60309 articles
Browse latest View live

Why is Discourse so slow on Android?

0
0

Jeff Atwood wrote:

When I was on vacation last week, I took my cellular Nexus 7 with me so I could keep up with Discourse posts, here and on our partner sites.

Now:

  • the Nexus 7 was never a super fast device even at launch
  • it was released in the ancient days of 2012
  • Discourse is a very intensive JavaScript application

So I wasn't exactly expecting barn-burning speeds.

I like using http://bbs.boingboing.net as a benchmark since it's our busiest site and I can go there any time of the day and many of the topics will consistently have new posts, and a lot of them are larger than the default post chunk size (20).

What I noticed was that Discourse performance was much worse than I remembered before on the Nexus 7. On a topic that has 20+ posts I saw this consistently:

  • time to the "loading.." indicator: 2 seconds
  • time to the topic loading a full 20 post chunk: 5 seconds

The Nexus 7 is substantially faster on small topics, where I'd see:

  • time to the 'loading.." indicator: 2 seconds
  • time to the topic loading 1 or 2 posts: 1 second

The majority of the performance problem comes in loading the posts, and seems to scale more or less linearly with the number of posts loaded in the topic, up to the maximum chunk size of 20.

But since many topics on BBS do have 20+ posts, it was excruciating to browse BBS and keep up with all the new posts on the Nexus 7 when I was paying a seven second penalty on every click. Brutal. Just brutal.

OK, so maybe the N7 is just old. Coincidentally, the new 2013 Nexus 7 was announced while I was on vacation. I immediately ordered 3 for the team and myself. It arrived literally the day I got back from vacation, this past Monday. It's easily twice as fast as the old model by every benchmark there is -- and it's plenty snappy in real world use!

So I excitedly unboxed the 2013 Nexus 7, updated it to latest over WiFi, and visited a large BBS topic, expecting a big free Moore's Law improvement:

  • time to the "loading.." indicator: 2 seconds
  • time to the topic loading a full 20 post chunk: 5 seconds

Err.. WTF? confused How can a 2x faster device have the same exact performance on Discourse as the old model? That's deeply concerning! We are building Discourse for the next decade of the Internet and we are assuming that newer devices will be faster. But this is exactly the same speed as the old device! How is that even possible, when every benchmark I read shows that the 2013 Nexus 7 is twice as fast as the 2012 model?

We did not see this with the iPad 3 and iPad 4, performance on Discourse scaled up with the device perfectly. I also noticed that the Surface RT, which is the same hardware as the Nexus 7, was not producing Discourse topic load times anything close to 7 seconds. It wasn't fast, exactly -- like I said the Tegra 3 hardware that the N7 and Surface RT are based on is not exactly speedy -- but it was much faster than the N7 in Discourse. Same hardware, different OS, different browser. I also tested with Firefox for Android and got the same exact numbers, even though (as far as I can tell) it is a completely different HTML and JS rendering engine.

This points toward Android as the problem.

Anecdotally, here are some rough load times observed on large, full-chunk (20 post) BBS topics on different devices:

  • Nexus 7 (both) -- 2 sec load, 5 sec posts
  • iPhone 5 -- 1 sec load, 2/3 sec posts
  • iPad 4 -- 1 sec load, 2 sec posts
  • Surface Pro -- instant load, 1 sec posts

Video demo of iPhone 5 vs Nexus 5 on the same Discourse pages:

The goal is for all devices to get to the Surface Pro (Intel i5) speeds over time, and I am confident that will happen in the next few years. However, if new Android devices are released and there's some crazy bottleneck we don't understand that prevents a JavaScript app like Discourse from scaling on new Android devices, that's.. a serious concern.

So @eviltrout spent the last few days looking in depth at this. The good news is he was able to increase N7 load times from 7 sec to 3-4 sec. But we have yet to find a "smoking gun" on Android that shows why, apparently, JavaScript performance is scaling so poorly to new devices.

I'll let him answer with details and pointers to the specific GitHub checkins.

We've heard that other devs have noticed poor JavaScript perf on Android devices -- does anyone have any specifics?

Posts: 59

Participants: 17

Read full topic


Configuring Facebook login for Discourse

0
0

Jeff Atwood wrote:

  1. Go to developers.facebook.com and create an app:

  2. Once the app is created, click on Settings on the left. Enter forum.example.com in the App Domains field.

  3. Then click Add Platform, choose Website, and enter http://forum.example.com in the Site URL field.

  4. Enter your email in the Contact Email field

  5. Under the Advanced tab (at the top), make sure Client OAuth Login is enabled. Enter http://forum.example.com/auth/facebook/callback in the Valid OAuth redirect URIs field.

  6. Click the Save Changes button.

  7. The App ID and App Secret go in the facebook_app_id and facebook_app_secret settings in the users section.

  8. Go to Status & Review and change "available to the general public" to Yes.

Basic settings

Advanced settings

Status & Review

Posts: 4

Participants: 4

Read full topic

Injecting Templates into Templates through plugins - introducing HAQL

0
0

Benjamin Kampmann wrote:

As already mentioned in the case-study about archetypes, the proposal for a plugin architecture and the tagger plugin, I have been investigating how plugins could extend templates without having to rely on on('didInsertElement) and the necessity to overwrite the whole plugin. Which turned out to be simpler than I expected.

Of course, you don't want to inject any template-code into the raw-handlebars-string. That would require some ugly sed-regexp-change-and-replace-magic. On the other end of the only have the rendered DOM-objects, where we have easy queries and ways to inject elements in a very nice fashion. Unfortunately DOM-manipulations are slow but even worth this injection works follow on-top (aka) after the handlebars/emberjs rendering magic and can easily interfere with that especially if that contains state-changing-{#if ..}-statements and {#each} loops. A pain to try to stick up-to-date with those.

If only there was an intermediate state in which we have a Javascript-objects-based representation of the template which we could manipulate before it gets compiled into a function. Turns out there is!

Handlebars, as it turns out, does compile templates in these three steps:

  1. use Handlebars.parse to generate an Abstract-Syntax-Tree of the template
  2. create the encapsulated environment and put the AST-object into it
  3. compile all of that with performance optimisation into a callable Javascript function.

And right there, between step 1 and 2, we have our Objects parsed from the template string into a query-able Object-tree. YAY. So I've made a little experiment in which we are overwriting the the default Handlebars.parse function and encapsulate it and passes its output through a list of injectors, that got previously registered. They then can manipulate that AST object, inject it's own parsed-template at very precise positions or even replace any given template data.

Unfortunately the AST-API isn't very pretty nor super-handy or made for traversing. So I've build a tiny query-language on top called Handlebars AST Query Language (HAQL) in order to make my hardest position case – inject the "tags"-rendering-snippet after the H1 of the topic, which is rendered within two {#if}-blocks – easily read- and writeable. This is what it looks like:

var patcher = Ember.TemplatePatcher;

patcher.addGeneralPatcher("061dd3942f735486fbc91b5c7dfcf7a6", function(ast, hash, str){
   # load template file via .erb extension
    var tag_inject = <%= evaluate("./inject/tags_view.html").to_json(); %>;
    Ember.TemplatePatcher.insertAt(ast, "if if if-else if[2]", tag_inject, {"shift": 1});
});

The way this works is as follows: Ember.TemplatePatcher is a new object you can register said injector at. I have currently only the "GeneralPatcher" implemented but later I'd like to also have a few more common patterns directly at the finger tips. The first parameter you pass to the registration is an md5 hash of the template, the second is a function that will be called with the AST, the Hash and the original string. If that returns a new object, it is assumed to be an AST to be used instead (which allows to create a new AST-object encapsulating the existing template in total for e.g. inside a {#if topic.articleArchetyp}...{#else}{/if})

The reason why this uses a hash had first an id-constrain-reason, as we from within handlebars don't know about the path or any other ID of the template and needed a way to id them for lookup – md5 is already part of our UI-toolchain, so, easy choice. But on second thought I actually like the idea a lot because as this is a rather sensitive part of the system the author should be really sure that this is the template at a certain version. With the md5 in place, you would have to add another hash for each update but that also ensure you are compatible on something where API/ABI-Versioning doesn't exist.

Coming back to the actual UI. As said, the injection isn't at an easy position and the AST does build a tree internally, so we need to traverse that tree to find the right position. Therefore insertAt doesn't only take a number as its second parameter but also a optionally a HAQL-query string – if if if-else if[2] in this case. It means: "go into the first if, then again the first if, then the first else and then the position after the second if". And with the optional "shift" parameter I can tell it mess around that position (as – unfortunately – the tree isn't building for non-mustache-objects) making it move by another piece after the h1.

At this position it then parses the given string (with Handlebars.parse, so it could potentially also be having injections) and adds the statements behind that position and that way become part of the official to-be-compiled template that is then rendered later including all features, the context and everything (as you can see in the example code). Adding features – like rendering tags under a topic title – with just a function call and no previously to-be-defined and potentially performance-heavy hooks in core-templates.


As said adding replace and maybe wrap-in-if are other very likely APIs to be added here. The only other changes this requires in core is another, additional hook-point for plugins. As their JS-assets are currently only included after the templates have been rendered, injection isn't possible. With my template-injector-branch this is possible.

Any feedback? Suggestions? Thoughts?

Posts: 14

Participants: 5

Read full topic

Error uploading files (max attachment size)

0
0

David García-Navas wrote:

We have edited the max_attachment_size_kb on admin dashboard to 13024 kB. In addition, we have configured the limit in nginx (client_max_body_size) and the same in apache.
But when we try to upload a file, if that file is bigger than 2 MB, the system doesn't complete the upload. The progress in percentage stops at certain number and restarts.

After two tries, it shows this error: Sorry, there was an error uploading that file. Please try again.

Any idea to solve this problem?

Posts: 5

Participants: 3

Read full topic

Problems sending email through sendgrid

0
0

Keith Newton wrote:

I'm trying to set up discourse to send emails through sendgrid and have run into some problems. I configured postfix per the sendgrid documentation as well as production.rb however it doesn't seem like the email is ever reaching sendgrid. It looks like postfix is trying to connect directly to the destination email address:

Sep 22 09:05:27 LinuxDev postfix/smtp[4061]: 3E37810502C: to=<johndoe@hotmail.com>, relay=none, delay=810, delays=660/0.11/150/0, dsn=4.4.1, status=deferred (connect to mx1.hotmail.com[65.54.188.126]:25: Connection timed out)
Sep 22 09:22:56 LinuxDev postfix/qmgr[3683]: 10FCB105025: from=<>, size=7580, nrcpt=1 (queue active)
Sep 22 09:22:56 LinuxDev postfix/qmgr[3683]: 3E37810502C: from=<info@discourse.org>, size=5883, nrcpt=1 (queue active)
Sep 22 09:23:27 LinuxDev postfix/smtp[4595]: connect to mx2.hotmail.com[65.55.92.152]:25: Connection timed out
Sep 22 09:23:27 LinuxDev postfix/smtp[4594]: connect to aspmx.l.google.com[173.194.79.26]:25: Connection timed out
Sep 22 09:23:27 LinuxDev postfix/smtp[4594]: connect to aspmx.l.google.com[2607:f8b0:400e:c01::1b]:25: Network is unreachable
Sep 22 09:23:57 LinuxDev postfix/smtp[4595]: connect to mx2.hotmail.com[65.55.92.168]:25: Connection timed out
Sep 22 09:23:57 LinuxDev postfix/smtp[4594]: connect to alt2.aspmx.l.google.com[74.125.140.26]:25: Connection timed out

For some reason it's also constantly trying to connect to google. Perhaps the last email I tried to send, which was to a gmail address, is stuck in a queue where Discourse is continually trying to send it?

Posts: 6

Participants: 3

Read full topic

{VAGRANT} Error on this command: vagrant up, when it tries to mount to NFS server

0
0

D Iff wrote:

When I run vagrant up, it's ok before this line:

Preparing to edit /etc/exports. Administrator privileges will be required...

After above prompt, it asks for password, and here is the error that occurs:

[sudo] password for diff:
nfsd running
sudo: /usr/bin/exportfs: command not found
==> default: Mounting NFS shared folders...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
mount -o 'vers=3,udp' 192.168.10.1:'/home/diff/discourse' /vagrant
Stdout from the command:
Stderr from the command:
stdin: is not a tty
mount.nfs: access denied by server while mounting 192.168.10.1:/home/diff/discourse

Posts: 14

Participants: 3

Read full topic

Flagged PMs send Notification to Mods but can't be found

0
0

Mittineague wrote:

Continuing the discussion from No notifcation on @mention in a private message when set to tracking:

While testing our new forum @ralphm Flagged a PM
I saw Notification, but could find no sign of them anywhere, neither Admin -> Flags Old or New, nor Admin -> Logs -> Staff Actions

Posts: 11

Participants: 3

Read full topic

Retrieving CSS customizations from the command line?

0
0

Zach Alexander wrote:

If a Discourse site is broken/inaccessible, is there a way to retrieve saved CSS customizations via ssh?

I'm assuming these are probably saved in the database somewhere, but I don't know how to access the database directly if I'm using Docker.

(This is in case I can't get my site working again per this thread.)

Posts: 2

Participants: 2

Read full topic


Hot off the presses, automated backup support!

0
0

Robin Ward wrote:

If you are on the latest version of Discourse, you can now enable automated daily backups, with support for uploading them offsite to S3!

I'm super proud of this feature because in my opinion not enough software (and certainly no forum software I am aware of) encourages users to create offsite backups of their data. The last thing you want in the event of a server failure is to lose all the awesome content your forum users have created.

Enabling this feature is easy! First go to the admin section and find backups under site settings. You'll see the following options:

Note that for the uploading to S3 support you'll need to have defined your s3 credentials as well. If you don't upload to S3 the backups will be left on the server filesystem.

Once you enable this, you can go to the backups tab in admin to view a list of backups that were performed with links to download or restore any images.

Let us know what you think of the feature and please help us try it out by enabling backups for your forums!

Posts: 20

Participants: 9

Read full topic

Ability to set the default notification settings

0
0

Nathan Rijksen wrote:

As far as I can tell there is currently no way to set what the default notification settings are for new users. It would be very useful if we could control this as it affects your daily returning visitors (with the default settings, people might forget they posted and only return a week later when they receive a notification).

Posts: 7

Participants: 4

Read full topic

I've come here after being disillusioned over and over for years

0
0

wynnyelle wrote:

Hi. I was referred here by someone who said this might be a good software for me to redo my site on. I've been trying to have my site done up exactly like I want it to with all the features I thought of it having, for several years now. Along the way, I've been swindled out of thousands of dollars by programmers who took my money and ran out on me without completing anything--the rest of the ones I hired or tried to hire either didn't have the time, the skill or flat out didn't want to do it. I'm at the point where I feel like I and my ideas are just poison. I'm on the verge of giving up.

My site is a heavily modified SMF fork. It uses PHP. I need to be able to finish the live chat feature that got only some of the way done before the programmer stopped working on it and said he couldn't complete it. {He was good about it, didn't charge me as a result.} I'm tired of my sites being half finished, and failing to thrive as a result. I have solidified concept, vision and plan for what I want it to be, and really all it does is incorporate things already done elsewhere but combine them in a new way, so I don't think it's all that revolutionary.

I'm lost. I don't know where to go or what to do, I just know I'm tired of running in circles. Latest programmer just told me he doesn't have time for my site anymore so I'm pretty much deserted at this time. I know some primitive HTML, and CSS and other than that I am not a programmer. What would you do? Please no sarcastic responses either, I only ask that you be polite to me. I'm just so upset, but I was referred here so I will at least introduce myself and see how things are while I figure out what I'm supposed to do next.

Thank you to anyone who can help.

Posts: 5

Participants: 2

Read full topic

User name restrictions are configurable but the ui seems to block them

0
0

Martin Heidegger wrote:

I set the username minimum to 0

but it is not possible for me to enter a username with length of 2

Seems like a bug (javascript?)

Posts: 5

Participants: 3

Read full topic

I SO get it! This thing rocks :)

0
0

gingerling wrote:

Hi, just wanted to say that I really really get this - I was reading the about page and was like, hey! this is my life right now! smile

So I got a fab job as a community manager for phpList, but I was shocked to find that nearly all the tools had no "how to make this awesome" manual. I have seen tools with user level how toos and developer level how too's but no "community manager" level documentation at all. I hope to spend some time this year documenting my experiences with some of these tools from this perspective smile

Keep up the amazing work with this, the forum is looking amazing, I love how it works! I have put this down as something for us to look into over the year and see about switching smile Any guides about the process of this would be great smile

Anna
phpList

Posts: 6

Participants: 4

Read full topic

Deleted posts included in post count

0
0

TechnoBear wrote:

On occasion, the green post count box includes deleted posts in the number visible to ordinary (non-mod) members, resulting in some weird numbers, such as 7 of 5. It clears on navigating away from the thread and returning.

So far, I've only spotted this happening on Chromium, but that may be a red herring.

(@zogstrip says this is a known issue, but I can't find an existing Bug report.)

Update:
I might be wrong here, but thinking about these instances, they seem to occur when (a) the final post in the thread is visible when the thread opens - so either a short thread, or one which has already been mostly read - and (b) post(s) have been made and deleted since the previous visit to the thread (if any).

Navigating away from the thread and then returning fixes the post count error.

Further Update:
The incorrect post count may or may not occur on entering the thread, but appears consistently when the member makes a post. It can sometimes be corrected by scrolling up and down, but sometimes not.

Posts: 1

Participants: 1

Read full topic

Log deleting all messages of a user

0
0

Sander Datema wrote:

When deleting all messages of a user, that action is not logged (while removing the user is). I think it's worth logging.

Posts: 1

Participants: 1

Read full topic


How to uninstall Docker the best way?

0
0

D Iff wrote:

How can I remove docker completely (with all images, etc) and install it from scratch?My docker version is 0.9.0 and I want to upgrade it. I have some problem with docker, so I prefer to have a fresh install.

Posts: 3

Participants: 2

Read full topic

Discourse for Learning Communities: UX Recs & Ideas

0
0

Vanessa Gennarelli wrote:

Hi, I'm Vanessa and I build learning communities for Peer 2 Peer University. We're using Discourse for our internal community and for our project-based moocs like Learning Creative Learning. We're also working with Mozilla on setting up their Discourse install for Webmaker and NYU for Play With Your Music. We're very "discursive" smile

I'm looking for some help / advice for designing the UX with some thinking towards pedagogy. To wit:

  1. Cohorts: what's the most graceful way to form cohorts? I was thinking of a.) assigning separate threads within a category (but then learners don't cross-pollinate), b.) asking people what their interest is (metal music, css) and waiting until 3 people like it to create the sub-category (but then they feel less in control of it/it's not emergent). Other suggestions?
  2. Categories: We've decided to make a category for each module--that way we can run the courses over and over. Is there a better way to do this?
  3. Adding resources: Should this be its own category or woven throughout the topics?
  4. Category display: what's the benefit of showing the top 5 posts in each category? Diversity within the topic? Sample posts?
  5. Avatars per category: do the top 5 posters automatically show up? Is there a way to change this to make it more inviting to new folks / doesn't look like a select few are dominating the conversation?
  6. Moderation: when folks complete the course, we were thinking about giving them full moderation privs. Benefits and drawbacks to that?
  7. Accessibility. We try to think about Universal Design for Learning, so we like that links expand and that the information appears contextually. What other ways have folks used Discourse to be inclusive of different types of community members (shy, color-blind, visual learners, etc).

Learning communities are really communities of practice, so there's a lot of overlap as far as community design principles. Thought folks here would have some tasty expertise. Merci!

EDIT: I bet @lightyear has some good ideas here smile

Posts: 1

Participants: 1

Read full topic

Accidental Formatting in Posts, an issue in other forums?

0
0

Briancguy wrote:

I get a lot of people accidentally using formatting codes that I'm sure they don't mean to. This screws up the message and confuses users. Does anyone else have this problem?

Does discourse use standard markdown type of formatting codes. Is there any way to turn some of these off in our instance of Discourse?

Here is an example, but I see much worse than this:

Posts: 3

Participants: 3

Read full topic

Moving discourse forum from subdomain to subdr

0
0

Filip Ćakić wrote:

So my forum is located at something.domain.com but i'd like to move it to something.domain.com/forum and have a Wordpress website on somethng.domain.com instead.

What would be the procedure to accomplish this? Is it complicated?

Posts: 15

Participants: 4

Read full topic

One line messages appear empty

0
0

Hedi Harzallah wrote:

My discourse was working just fine.
I recently noticed that messages that are written only one line appear empty.
When I edit the message, I see original text.
I have to add a line break for the message to show.
Do you have an idea on how I can solve this issue ?

ps : I'm on the latest version of discourse

Posts: 6

Participants: 2

Read full topic

Viewing all 60309 articles
Browse latest View live




Latest Images