简体   繁体   English

Grails Application在运行时花费了很多时间在localhost时间7分钟至10分钟

[英]Grails Application while for run it taking to much to UP on localhost time 7 min to 10 min

I have laptop 8 GB ram and I5 processor, Grails 2.4.4 and Java 7. while running application it taking to much time 7 to 8 min. 我有笔记本电脑8 GB内存和I5处理器,Grails 2.4.4和Java7。在运行应用程序时,这需要花费7至8分钟的时间。 is need to set JAVA_OPTS or GRAILS_OPTS. 需要设置JAVA_OPTS或GRAILS_OPTS。 Using intellji 14 IDE. 使用intellji 14 IDE。

Sometimes people write a question without actually considering that the people it is presented to have no idea what it is the end user has going on at their end. 有时,人们在写问题时并未真正考虑到所提出的人们对最终用户到底是怎么回事。

The problem with a question like above is the lack of actual information as to the real information of what it is you are trying to achieve. 上面的问题的问题在于,您缺乏实际信息,无法获得您要实现的目标的真实信息。

You should always consider when you say a grails application from a basic grails create-app to where you are is your concept no one out there has any ideas of what it is you are asking it to do. 当您说从基本grails创建应用程序到您的概念所在的grails应用程序时,您应该始终考虑到那里没有人对您要执行的操作有任何想法。 They will in their minds compare it to a basic app. 他们会在脑海中将其与基本应用进行比较。

When hitting an issue in an application these are the things to consider 在应用程序中遇到问题时,需要考虑以下事项

  1. Enabling logging for the database - Look into enabling your database to generate logs. 启用数据库日志记录-研究启用数据库生成日志。 You can also enable logs within mysql or what ever database you are using to get more of an idea of what is being crunched through. 您还可以在mysql或正在使用的任何数据库中启用日志,以更好地了解正在处理的内容。

  2. Enable logging on your application look into adding this to build.gradle : 启用登录您的应用程序,看看将其添加到build.gradle:

    console "org.grails:grails-console" 控制台“ org.grails:grails-console”

Then in 然后在

logback.groovy logback.groovy

at the very end of the file add something like this: 在文件的末尾添加以下内容:

 logger("com.mypackage", DEBUG, ["CONSOLE"])
 logger("com.mypackage", INFO, ["CONSOLE"])
 logger("com.mypackage", WARN, ["CONSOLE"])
 logger("com.mypackage", ERROR, ["CONSOLE"])

Then hopefully your own code should output the debug error statements - Enable logging for your schedule tasks as the app start - measure the start end time - compare them - 然后希望您自己的代码应输出调试错误语句-在应用程序启动时启用计划任务的日志记录-测量开始结束时间-比较它们-

this will give you an idea as to how long those things are taking. 这会让您对这些事情花费多长时间有所了解。

In regards to grails and JVM it all depends on what version of JVM you are running JDK 8 is slightly different to JDK7. 关于grails和JVM,这完全取决于您正在运行的JVM版本。JDK8与JDK7略有不同。

export GRAILS_OPTS="-Xmx1G -Xms1024m -XX:MaxPermSize=1024m"
export MAVEN_OPTS="-XX:MaxPermSize=1024m -Xms1024m -Xmx1024m"
export JAVA_OPTS='-server -Xms1024m -Xmx1024m -XX:PermSize=1024m -XX:MaxPermSize=1024m'

That is for Linux you can find out how to export out the variables for windows and increase decrease them. 也就是说,对于Linux,您可以找到如何导出Windows变量并增加和减少变量的方法。

So far as I am running 8 gig and 16 processor. 到目前为止,我正在运行8 gig和16处理器。 Again it is all based on JVM configuration. 同样,它们全部基于JVM配置。 If I have the same but then have it configured to run as 256k JVM. 如果我有相同的配置,但是将其配置为以256k JVM的身份运行。 Well all the rest is sitting there not doing much for the actual JVM. 好吧,其余的一切对于实际的JVM并没有多大帮助。

Hope it is making a little more sense and hope if anything you understand that when raising a question you need to think of the audience that will read it and their conception of what you mean for example of I am running an app. 希望它变得更有道理,并希望您是否理解在提出问题时需要考虑将要阅读的读者以及他们对您的意思的理解,例如我正在运行一个应用程序。 You need to elaborate you should really be asking a more specific question after you have done some of above and worked out a more specific issue that someone could better answer. 您需要详细说明自己,在完成以上某些操作并提出一个更具体的问题后,人们应该可以更好地回答这个问题。 At the moment it is a needle in a haystack 目前,它是大海捞针

In regards to plugins, always take a read at their documentation for example spring security can have logging enabled. 关于插件,请务必阅读其文档,例如spring security可以启用日志记录。 Have you looked into that as yet ? 你有没有研究过? to see what this is doing or how about disabling spring security as a test ? 看看这是做什么的,或者禁用Spring Security作为测试呢?

grails.plugin.springsecurity.active = false      

You see there is a lot you could have already been doing to help yourself be in a better poisition of understanding the fault. 您会发现您本可以做很多事情来帮助自己更好地理解故障。 When my toe hurts it only hurts me not the person sitting next to me :) 当我的脚趾受伤时,只会伤害我,而不会伤害我旁边的人:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从 Powershell 读取 output 需要很多时间来执行 - Reading output from Powershell takes much time to execute gwt应用程序的爬虫花费太多时间 - crawler for gwt application taking too much time 我的GUI在运行时占用了太多资源 - my gui is taking too much resources in run time 在 window 期间每 30 分钟运行一次任务 - Run a task every 30 min during time window 在Tomcat 7中超时持续10分钟 - Timeout last 10 min in Tomcat 7 进行扫描仪输入并输出最小和最大 - Taking scanner input and outputting min and max 如何在不使用 InetAddress 类或避免 10 分钟缓存时间的情况下获取 DNS 解析时间? - How to get the DNS resolution time without using the class InetAddress or avoiding the 10 min cached time? 递出浏览器身份验证后,Selenium需要太多时间来执行命令 - Selenium is taking too much time to execute a command after handing browser authentication pop up 如何将日期时间 hh: mm 插入按时间排序的数组列表中,仅当时间在插入点之前或之后 10 分钟时 - how to insert a date-time hh: mm into an array list sorted by times only if the time is 10 min before or after the insertion point 使用DI时,播放2.4在第一次请求时花费更多时间 - Play 2.4 taking much more time on first request while using DI
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM